Ejemplo n.º 1
0
        public LoadStateResponse GetState()
        {
            _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}");
            try
            {
                var states = _webMasterService.RetrieveState();

                _logger.LogInformation($"Received state master data {states}");
                return(states.Count == 0 ?
                       new LoadStateResponse {
                    Status = "true", Message = "No record found", State = new List <LoadState>()
                }
                    : new LoadStateResponse {
                    Status = "true", Message = string.Empty, State = states
                });
            }
            catch (Exception e)
            {
                _logger.LogError($"Error in receiving state data {e.StackTrace}");
                return(new LoadStateResponse {
                    Status = "false", Message = e.Message, State = null
                });
            }
        }