Ejemplo n.º 1
0
        public LoadCommunityResponse GetCommunity()
        {
            _logger.LogInformation($"Invoking endpoint: {this.HttpContext.Request.GetDisplayUrl()}");
            try
            {
                var community = _webMasterService.RetrieveCommunity();

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