Esempio n. 1
0
        public async Task <IActionResult> AddClient([FromBody] ClientData client)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            try
            {
                await _clientServices.AddClientNV(client);

                _logger.LogInformation("add client.");

                await _clientServices.GetClientNV(client);

                return(new ObjectResult(client));
            }
            catch (Exception e)
            {
                _logger.LogError(e.ToString());

                return(StatusCode((int)System.Net.HttpStatusCode.InternalServerError, "error adding client."));
            }
        }