public ActionResult Count() { if (!Request.IsAuthenticated) { return(null); } IEnumerable <DomainStatistics> stats = null; if (Session.User.IsAdministrator) { stats = domainStatSource.GetDomainStatistics(); } else { stats = domainStatSource.GetDomainStatisticsByUser(Session.User); } return(Json(stats.Select(i => new { i.Id, i.Pattern, i.Count, i.ParentId }))); }
public DomainStatistics[] GetDomainStatistics() { return(ToArray(_dataSource.GetDomainStatistics())); }