Exemple #1
0
 public static CourtWebsite GetCourtWebSite(ObjectId id)
 {
     CourtWebsite cw = new CourtWebsite();
     Task.Run(async () =>
     {
         var filter = Builders<CourtWebsite>.Filter.Eq("Id", id);
         cw = await GetCourtWebSiteCollection().Find(filter).FirstAsync();
     }).Wait();
     return cw;
 }
Exemple #2
0
        public static void InsertNewCourt(string courtName, string url, string courtKey, string xPath)
        {
            var courtWebsite = new CourtWebsite
            {
                Id = ObjectId.GenerateNewId(),
                Url = url,
                CourtName = courtName,
                OldPageHtml = "Never Diffed",
                NewPageHtml = "Never Diffed",
                DiffedHtml = "Never Diffed",
                LastChangedDateTime = DateTime.MinValue,
                LastRunDateTime = DateTime.MinValue,
                SelectionXPathString = xPath,
                Checked = false
            };

            Task.Run(async () =>
            {
                await GetCourtWebSiteCollection().InsertOneAsync(courtWebsite);
            }).Wait();
        }
Exemple #3
0
 /// <summary>
 /// overload to handle a courtwebsite object
 /// </summary>
 /// <param name="courtWebsite"></param>
 public static void InsertNewCourt(CourtWebsite courtWebsite)
 {
     InsertNewCourt(courtWebsite.CourtName, courtWebsite.Url, courtWebsite.CourtKey, courtWebsite.SelectionXPathString);
 }