dmvcframework-3_1_1-beryllium-RC3

This commit is contained in:
Daniele Teti 2019-03-08 09:49:21 +01:00
parent beb059a0e3
commit 8ee3efc384
6 changed files with 44 additions and 24 deletions

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -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;

View File

@ -1,2 +1,2 @@
const
DMVCFRAMEWORK_VERSION = '3.1.1 (beryllium) RC2';
DMVCFRAMEWORK_VERSION = '3.1.1 (beryllium) RC3';

View File

@ -108,6 +108,7 @@ def copy_sources():
]
folders = [
"d100",
"d101",
"d102",
"d103"