Пример #1
0
        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);
        }
Пример #2
0
        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);
        }
Пример #3
0
        public async Task <IActionResult> AddClient([FromBody] Client client)
        {
            Client result;

            try
            {
                result = await _clientRepository.Create(client);
            }
            catch (Exception ex)
            {
                return(BadRequest());
            }
            return(Ok(result));
        }
Пример #4
0
 public bool Create(Clients client)
 {
     return(_clientsRepository.Create(client));
 }