예제 #1
0
        public ActionResult GetDetailsById(int id)
        {
            try
            {
                _logger.Log(LogLevel.Information, string.Format("GET:Customer details API for id:{0} Invoked.", id));
                var result = _customerRepo.GetByMockDataId(id);

                if (result == null)
                {
                    return(NotFound());
                }

                return(Ok(result));
            }
            catch (Exception)
            {
                _logger.Log(LogLevel.Information, string.Format("GET:Customer details API for id:{0} failed.", id));
                return(StatusCode(StatusCodes.Status500InternalServerError,
                                  "Error retrieving data"));
            }
        }