Пример #1
0
        public ActionResult Insert([FromBody] Customer customer)
        {
            try
            {
                _logger.Log(LogLevel.Information, "POST:Insert Customer details API Invoked.");
                if (customer == null)
                {
                    return(BadRequest());
                }

                int id = _customerRepo.InsertCustomerData(customer);
                return(Ok(id));
            }
            catch (Exception)
            {
                _logger.Log(LogLevel.Error, "POST:Insert Customer details API failed.");
                return(StatusCode(StatusCodes.Status500InternalServerError,
                                  "Error sending data"));
            }
        }