예제 #1
0
        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 })));
        }
예제 #2
0
 public DomainStatistics[] GetDomainStatistics()
 {
     return(ToArray(_dataSource.GetDomainStatistics()));
 }