public async Task<ClientModel> CreateCliente(ClientModel clienteModel) { var oCliente = new Client { Name = clienteModel.Name, Description = clienteModel.Description, Secret = Helper.GetHash(Guid.NewGuid().ToString()), AllowedOrigin = clienteModel.AllowedOrigin, Active = clienteModel.Active, ApplicationType = clienteModel.ApplicationType, ImgName = clienteModel.ImgName }; var result = _ctx.Clients.Add(oCliente); var save = await _ctx.SaveChangesAsync(); return Client.GetFromEntitie(result); }
public static ClientModel GetFromEntitie(Client cliente) { return new ClientModel { Id = cliente.Id, Name = cliente.Name, Secret = cliente.Secret, Description = cliente.Description, Active = cliente.Active, ImgName = cliente.ImgName, AllowedOrigin = cliente.AllowedOrigin, ApplicationType = cliente.ApplicationType, RefreshTokenLifeTime = cliente.RefreshTokenLifeTime, RefreshKey = false }; }