/// <summary> /// This wipes all the existing orders and creates a new set of orders /// </summary> /// <param name="context"></param> /// <param name="books"></param> public static void ResetOrders(this EfCoreContext context, List <Book> books = null) { context.RemoveRange(context.Orders.ToList()); //remove the existing orders (the lineitems will go too) context.AddDummyOrders(books); //add a dummy set of orders context.SaveChanges(); }