Esempio n. 1
0
        public LoadConstantResponse GetConstantValues(int userId)
        {
            _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}");
            try
            {
                var constantValues = _webMasterService.RetrieveConstantValues(userId);

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