Ejemplo n.º 1
0
        public LoadCommonResponse RetrieveRIByANM(int id)
        {
            _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}");
            _logger.LogDebug($"Fetch  RI by ANM - {JsonConvert.SerializeObject(id)}");
            try
            {
                var data = _webMasterService.RetrieveRIByANM(id);

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