private async static Task FillDocs()
        {
            var deleteSetting = ConfigurationManager.AppSettings["Settings:DeleteDocuments"];
            var deleteFirst   = !string.IsNullOrEmpty(deleteSetting) && bool.Parse(deleteSetting);
            var docdbCtx      = DocumentDbContextFactory.New();

            if (deleteFirst)
            {
                await DeleteCollections(docdbCtx);
            }
            await CreateNeededCollections(docdbCtx);

            var trackedRidesFiller = new TrackedRidesFiller();

            Console.WriteLine("Filling up TrackedRides collection");
            var rides = await trackedRidesFiller.CreateTrackedRides();

            Console.WriteLine("Creating summary");
            await AddRidesToSummary(trackedRidesFiller.DocumentContext, rides);
        }
Beispiel #2
0
 public TrackedRidesFiller()
 {
     _docCtx    = DocumentDbContextFactory.New();
     _routesGps = new Dictionary <string, GpsPoint[]>();
 }