コード例 #1
0
        public LoadAssociatedANMResponse GetANM(int riId)
        {
            _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}");
            try
            {
                var associatedANM = _webMasterService.RetrieveAssociatedANM(riId);

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