Пример #1
0
        public LoadMolecularLabResponse GetMolecularLab(int centralLabId)
        {
            _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}");
            try
            {
                var molecularLab = _webMasterService.RetrieveMolecularLabbyCentralLab(centralLabId);

                _logger.LogInformation($"Received molecular lab master data by central lab {molecularLab}");
                return(molecularLab.Count == 0 ?
                       new LoadMolecularLabResponse {
                    Status = "true", Message = "No record found", MolecularLab = new List <LoadMolecularLab>()
                }
                    : new LoadMolecularLabResponse {
                    Status = "true", Message = string.Empty, MolecularLab = molecularLab
                });
            }
            catch (Exception e)
            {
                _logger.LogError($"Error in receiving molecular lab master data by central lab {e.StackTrace}");
                return(new LoadMolecularLabResponse {
                    Status = "false", Message = e.Message, MolecularLab = null
                });
            }
        }