public IActionResult UpdateGraphs(GraphFilters filters) { if (!string.IsNullOrWhiteSpace(filters.ToString())) { _user = _context.User.FirstOrDefault(p => p.EmailAddress == _userManager.GetUserAsync(User).GetAwaiter().GetResult().Email); var companyID = _user.CompanyID; //We need to build the datasets for the graphs into the viewbag var articlesRead = _context.ArticleReporting.Where(m => m.CompanyID == companyID && m.SegmentName == filters.magazine); string[] articles = articlesRead.Select(d => d.ArticleName).Distinct().ToArray(); SetupViewsPerArticleReport(articlesRead); return(Json(articles)); } return(null); }