Ejemplo n.º 1
0
  /// <summary>
  /// Go thru each site collection records from DB
  /// </summary>
  /// <param name="dbContext">The database context</param>
  /// <param name="siteList">The site collection record list</param>
 protected override void ResolveSitesFromDb(GovernanceDbContext dbContext, List<string> siteList)
 {
     int maxPage;
     int page = 1;
     do
     {
         var sites = dbContext.GetAllSites(page, PageSize, out maxPage);
         foreach (var site in sites)
         {
             siteList.Add(site.Url);
         }
     }
     while (page++ < maxPage);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Query database by union each policy's noncompliance predictor criteria
 /// </summary>
 /// <param name="dbContext">The database context object</param>
 /// <param name="siteList">The site collection record list</param>
 protected override void ResolveSitesFromDb(GovernanceDbContext dbContext, List<string> siteList)
 {
     int maxPage;
     int page = 1;
     do
     {
         var expressions = from policy in PolicyManager.GetAllGovernancePolicy()
                           select policy.NoncompliancePredictor;
         var sites = dbContext.GetAllSites(
             page, PageSize, out maxPage, Includes, expressions.ToArray());
         foreach (var site in sites)
         {
             siteList.Add(site.Url);
         }
     }
     while (page++ < maxPage);
 }