コード例 #1
0
        public LoadCHCResponse GetCHCbyCentralLab(int centralLabId)
        {
            _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}");
            try
            {
                var chc = _webMasterService.RetrieveCHCbyCentralLab(centralLabId);

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