mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-15 07:45:54 +01:00
+ added overloaded constructors to all MVCFrom* attributes (allows to pass a default values as string, integer and boolean)
This commit is contained in:
parent
79407d71e1
commit
d2157919fe
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user