mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-15 15:55:54 +01:00
dmvcframework-3_1_1-beryllium-RC3
This commit is contained in:
parent
beb059a0e3
commit
8ee3efc384
@ -176,10 +176,10 @@ end;
|
||||
function TMyObject.GetStringDictionary: TMVCStringDictionary;
|
||||
begin
|
||||
Result := TMVCStringDictionary.Create;
|
||||
Result.AddProperty('key1', 'value1');
|
||||
Result.AddProperty('key2', 'value2');
|
||||
Result.AddProperty('key3', 'value3');
|
||||
Result.AddProperty('key4', 'value4');
|
||||
Result.Add('key1', 'value1');
|
||||
Result.Add('key2', 'value2');
|
||||
Result.Add('key3', 'value3');
|
||||
Result.Add('key4', 'value4');
|
||||
end;
|
||||
|
||||
function TMyObject.GetUser(aUserName: string): TPerson;
|
||||
|
@ -28,7 +28,7 @@ interface
|
||||
|
||||
uses
|
||||
MVCFramework.Serializer.Intf,
|
||||
System.Rtti;
|
||||
System.Rtti, MVCFramework.Serializer.Commons;
|
||||
|
||||
type
|
||||
// Custom serializer for TNullableAliasSerializer type
|
||||
@ -43,7 +43,8 @@ type
|
||||
procedure SerializeRoot(
|
||||
const AObject: TObject;
|
||||
out ASerializerObject: TObject;
|
||||
const AAttributes: TArray<TCustomAttribute>
|
||||
const AAttributes: TArray<TCustomAttribute>;
|
||||
const ASerializationAction: TMVCSerializationAction = nil
|
||||
);
|
||||
|
||||
procedure DeserializeAttribute(
|
||||
@ -77,7 +78,8 @@ type
|
||||
procedure SerializeRoot(
|
||||
const AObject: TObject;
|
||||
out ASerializerObject: TObject;
|
||||
const AAttributes: TArray<TCustomAttribute>
|
||||
const AAttributes: TArray<TCustomAttribute>;
|
||||
const ASerializationAction: TMVCSerializationAction = nil
|
||||
);
|
||||
|
||||
procedure DeserializeAttribute(
|
||||
@ -111,7 +113,8 @@ type
|
||||
procedure SerializeRoot(
|
||||
const AObject: TObject;
|
||||
out ASerializerObject: TObject;
|
||||
const AAttributes: TArray<TCustomAttribute>
|
||||
const AAttributes: TArray<TCustomAttribute>;
|
||||
const ASerializationAction: TMVCSerializationAction = nil
|
||||
);
|
||||
|
||||
procedure DeserializeAttribute(
|
||||
@ -145,7 +148,8 @@ type
|
||||
procedure SerializeRoot(
|
||||
const AObject: TObject;
|
||||
out ASerializerObject: TObject;
|
||||
const AAttributes: TArray<TCustomAttribute>
|
||||
const AAttributes: TArray<TCustomAttribute>;
|
||||
const ASerializationAction: TMVCSerializationAction = nil
|
||||
);
|
||||
|
||||
procedure DeserializeAttribute(
|
||||
@ -173,8 +177,7 @@ uses
|
||||
Spring,
|
||||
MVCFramework.Serializer.JsonDataObjects,
|
||||
BusinessObjectsU,
|
||||
System.SysUtils,
|
||||
MVCFramework.Serializer.Commons;
|
||||
System.SysUtils;
|
||||
|
||||
procedure TNullableIntegerSerializer.Deserialize(const ASerializedObject: TObject;
|
||||
var AElementValue: TValue; const AAttributes: TArray<TCustomAttribute>);
|
||||
@ -224,8 +227,12 @@ begin
|
||||
(ASerializerObject as TJDOJsonObject).Values[APropertyName] := nil;
|
||||
end;
|
||||
|
||||
procedure TNullableIntegerSerializer.SerializeRoot(const AObject: TObject;
|
||||
out ASerializerObject: TObject; const AAttributes: TArray<TCustomAttribute>);
|
||||
procedure TNullableIntegerSerializer.SerializeRoot(
|
||||
const AObject: TObject;
|
||||
out ASerializerObject: TObject;
|
||||
const AAttributes: TArray<TCustomAttribute>;
|
||||
const ASerializationAction: TMVCSerializationAction = nil
|
||||
);
|
||||
begin
|
||||
raise EMVCSerializationException.Create('Not supported');
|
||||
end;
|
||||
@ -281,8 +288,12 @@ begin
|
||||
(ASerializerObject as TJDOJsonObject).Values[APropertyName] := nil;
|
||||
end;
|
||||
|
||||
procedure TNullableCurrencySerializer.SerializeRoot(const AObject: TObject;
|
||||
out ASerializerObject: TObject; const AAttributes: TArray<TCustomAttribute>);
|
||||
procedure TNullableCurrencySerializer.SerializeRoot(
|
||||
const AObject: TObject;
|
||||
out ASerializerObject: TObject;
|
||||
const AAttributes: TArray<TCustomAttribute>;
|
||||
const ASerializationAction: TMVCSerializationAction = nil
|
||||
);
|
||||
begin
|
||||
raise EMVCSerializationException.Create('Not supported');
|
||||
end;
|
||||
@ -338,8 +349,12 @@ begin
|
||||
(ASerializerObject as TJDOJsonObject).Values[APropertyName] := nil;
|
||||
end;
|
||||
|
||||
procedure TNullableStringSerializer.SerializeRoot(const AObject: TObject;
|
||||
out ASerializerObject: TObject; const AAttributes: TArray<TCustomAttribute>);
|
||||
procedure TNullableStringSerializer.SerializeRoot(
|
||||
const AObject: TObject;
|
||||
out ASerializerObject: TObject;
|
||||
const AAttributes: TArray<TCustomAttribute>;
|
||||
const ASerializationAction: TMVCSerializationAction = nil
|
||||
);
|
||||
begin
|
||||
raise EMVCSerializationException.Create('Not supported');
|
||||
end;
|
||||
@ -382,8 +397,12 @@ begin
|
||||
TJDOJsonObject(ASerializerObject).O[APropertyName] := lJSON;
|
||||
end;
|
||||
|
||||
procedure TPersonSerializer.SerializeRoot(const AObject: TObject;
|
||||
out ASerializerObject: TObject; const AAttributes: TArray<TCustomAttribute>);
|
||||
procedure TPersonSerializer.SerializeRoot(
|
||||
const AObject: TObject;
|
||||
out ASerializerObject: TObject;
|
||||
const AAttributes: TArray<TCustomAttribute>;
|
||||
const ASerializationAction: TMVCSerializationAction = nil
|
||||
);
|
||||
var
|
||||
lPerson: TPerson;
|
||||
lJSON: TJDOJsonObject;
|
||||
|
@ -63,9 +63,9 @@ var
|
||||
lDict: TMVCStringDictionary;
|
||||
begin
|
||||
lDict := TMVCStringDictionary.Create;
|
||||
lDict.AddProperty('prop1', 'one');
|
||||
lDict.AddProperty('prop2', 'two');
|
||||
lDict.AddProperty('prop3', 'three');
|
||||
lDict.Add('prop1', 'one');
|
||||
lDict.Add('prop2', 'two');
|
||||
lDict.Add('prop3', 'three');
|
||||
Render(lDict);
|
||||
end;
|
||||
|
||||
|
@ -153,7 +153,7 @@ begin
|
||||
|
||||
lResp := TMVCActiveRecordListResponse.Create(TMVCActiveRecord.SelectRQL(lARClassRef, lRQL, GetMaxRecordCount), True);
|
||||
try
|
||||
lResp.Metadata.AddProperty('count', lResp.Items.Count.ToString);
|
||||
lResp.Metadata.Add('count', lResp.Items.Count.ToString);
|
||||
Render(lResp);
|
||||
except
|
||||
lResp.Free;
|
||||
|
@ -1,2 +1,2 @@
|
||||
const
|
||||
DMVCFRAMEWORK_VERSION = '3.1.1 (beryllium) RC2';
|
||||
DMVCFRAMEWORK_VERSION = '3.1.1 (beryllium) RC3';
|
Loading…
Reference in New Issue
Block a user