private static Task <int> unloadDB(CosmoContext context)
 {
     context.RemoveRange(context.Subscriber); //Remove contents of Subscriber table from context
     context.RemoveRange(context.Location);   //Remove contents of Location table from context
     context.RemoveRange(context.Route);      //Remove contents of Route table from context
     context.RemoveRange(context.Region);     //Remove contents of Region table from context
     context.RemoveRange(context.Admin);
     return(context.SaveChangesAsync());      //Save changes
 }
예제 #2
0
        public static void Reload(CosmoContext context)
        {
            context.RemoveRange(context.Location);
            context.SaveChanges();

            Load(context);
        }
예제 #3
0
        /// <summary>
        /// This method will remove all Routes from the TestCosmoDB and then add new routes back into the TestCosmoDB
        /// Will need to update later to account for additional fixtures
        /// </summary>
        /// <param name="context"></param>
        public static void Reload(CosmoContext context)
        {
            context.RemoveRange(context.Subscriber); //Tracks the routes that are removed.
            context.SaveChanges();

            Load(context); //calls the Load method to load new routes into the TestCosmoDB
        }
예제 #4
0
        /// <summary>
        /// Helper Method to remove contents of the Context
        /// </summary>
        /// <param name="context"></param>
        private void unloadDB(CosmoContext context)
        {
            //Unload DB
            context.RemoveRange(context.Subscriber);
            context.RemoveRange(context.Location);
            context.RemoveRange(context.Region); //Remove contents of Region table from context
            context.RemoveRange(context.Route);  //Remove contents of Route table from context
            context.RemoveRange(context.Admin);
            context.RemoveRange(context.LocationRoute);

            context.SaveChanges();  //Save changes
        }
예제 #5
0
 /// <summary>
 /// This method will remove the existing routes from the TestCosmoDB and commits the changes
 /// Will need to update later to account for additional fixtures
 /// </summary>
 /// <param name="context"></param>
 public static void Unload(CosmoContext context)
 {
     context.RemoveRange(context.Subscriber);
     context.SaveChanges();
 }
예제 #6
0
 /// <summary>
 /// Removes any admins currently in the context
 /// </summary>
 /// <param name="context"></param>
 public static void Unload(CosmoContext context)
 {
     context.RemoveRange(context.Admin);
     context.SaveChanges();
 }