public void Create(Client client) { ValidateClientInformation(client); if (!string.IsNullOrEmpty(client._id)) { throw new ArgumentException("client._id deberia ser nulo o vacio"); } UpdatePossibleDeathDate(client); clientsRepository.Create(client); }
public async Task <CreateEntityResponse> Create(CreateClientRequest client) { var newClient = new Client { Name = client.Name, Description = client.Description, EmployerId = client.EmployerId }; var result = await _clientsRepo.Create(newClient); return(result); }
public async Task <IActionResult> AddClient([FromBody] Client client) { Client result; try { result = await _clientRepository.Create(client); } catch (Exception ex) { return(BadRequest()); } return(Ok(result)); }
public bool Create(Clients client) { return(_clientsRepository.Create(client)); }