mirror of
https://github.com/danieleteti/delphimvcframework.git
synced 2024-11-15 15:55:54 +01:00
52 lines
1.1 KiB
ObjectPascal
52 lines
1.1 KiB
ObjectPascal
unit Services.PeopleU;
|
|
|
|
interface
|
|
|
|
uses
|
|
System.Generics.Collections, Entities, Services.InterfacesU, MVCFramework.Logger,
|
|
MVCFramework, MVCFramework.Container;
|
|
|
|
type
|
|
TPeopleService = class(TInterfacedObject, IPeopleService)
|
|
private
|
|
fConnService: IConnectionService;
|
|
public
|
|
[MVCInject]
|
|
constructor Create(ConnectionService: IConnectionService); virtual;
|
|
destructor Destroy; override;
|
|
function GetAll: TObjectList<TPerson>;
|
|
end;
|
|
|
|
implementation
|
|
|
|
uses
|
|
System.SysUtils {IntToHex};
|
|
|
|
{ TPeopleService }
|
|
|
|
constructor TPeopleService.Create(ConnectionService: IConnectionService);
|
|
begin
|
|
inherited Create;
|
|
fConnService := ConnectionService;
|
|
LogI('Service ' + ClassName + ' created [' + IntToHex(NativeUInt(Pointer(Self))) + ']');
|
|
end;
|
|
|
|
destructor TPeopleService.Destroy;
|
|
begin
|
|
LogI('Service ' + ClassName + ' destroyed [' + IntToHex(NativeUInt(Pointer(Self))) + ']');
|
|
inherited;
|
|
end;
|
|
|
|
function TPeopleService.GetAll: TObjectList<TPerson>;
|
|
begin
|
|
Result := TObjectList<TPerson>.Create;
|
|
Result.AddRange([
|
|
TPerson.Create,
|
|
TPerson.Create,
|
|
TPerson.Create,
|
|
TPerson.Create
|
|
]);
|
|
end;
|
|
|
|
end.
|