+ added overloaded constructors to all MVCFrom* attributes (allows to pass a default values as string, integer and boolean)

This commit is contained in:
Daniele Teti 2021-10-07 10:08:53 +02:00
parent 79407d71e1
commit d2157919fe
2 changed files with 15 additions and 1 deletions

View File

@ -319,6 +319,8 @@ type
public
constructor Create(const AParamName: string); overload;
constructor Create(const AParamName: string; const DefaultAsString: string); overload;
constructor Create(const AParamName: string; const DefaultAsInteger: Int64); overload;
constructor Create(const AParamName: string; const DefaultAsBoolean: Boolean); overload;
property ParamName: string read FParamName;
property DefaultValueAsString: string read FDefaultValueAsString;
property CanBeUsedADefaultValue: Boolean read FCanBeUsedADefaultValue;
@ -1152,6 +1154,18 @@ begin
FCanBeUsedADefaultValue := False;
end;
constructor MVCInjectableParamAttribute.Create(const AParamName: string;
const DefaultAsInteger: Int64);
begin
Create(AParamName, DefaultAsInteger.ToString);
end;
constructor MVCInjectableParamAttribute.Create(const AParamName: string;
const DefaultAsBoolean: Boolean);
begin
Create(AParamName, iif(DefaultAsBoolean,'true','false'));
end;
{ MVCProducesAttribute }
constructor MVCProducesAttribute.Create(const AValue, ACharset: string);

View File

@ -12,7 +12,7 @@ from pathlib import Path
init()
DEFAULT_DELPHI_VERSION = "10.4"
DEFAULT_DELPHI_VERSION = "11"
g_releases_path = "releases"
g_output = "bin"