Example #1
0
        public LoadSCResponse GetSC(int userId)
        {
            _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}");
            try
            {
                var sc = _webMasterService.RetrieveSC(userId);

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