Ejemplo n.º 1
0
        public LoadCHCResponse GetCHCbyTestingCHC(int testingCHCId)
        {
            _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}");
            try
            {
                var chc = _webMasterService.RetrieveCHCbyTestingCHC(testingCHCId);

                _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
                });
            }
        }