Skip to content

Instantly share code, notes, and snippets.

@tkovs
Last active June 16, 2018 13:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tkovs/f76c5077f2e030f4de860b22534dd4fb to your computer and use it in GitHub Desktop.
Save tkovs/f76c5077f2e030f4de860b22534dd4fb to your computer and use it in GitHub Desktop.
Mapeamento de json para objeto
{
"data": {
"id": 1,
"nome": "Dolly",
"data_hora_criacao": "2018-04-10 11:22:22",
}
}
type
TEmpresa = Class
private
FId : Integer;
FNome : String;
FDataCriacao : TDateTime;
function GetId() : Integer;
function GetNome(): String;
procedure SetNome(const Value: String);
function GetDataCriacao(): TDateTime;
public
property Id : Integer
read GetId;
property Nome : String
read GetNome
write SetNome;
property DataCriacao : TDateTime
read GetDataCriacao;
constructor Create(
const AId : Integer;
const ANome : String;
const ADataCriacao : TDateTime;
);
End;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment