public static async Task PopulateDummyCars(int NumberOfCars) { // Ask the DBContextFactory to create the desired DbContext object for use for database access DSuiteContext db = DBContextFactory.GetDbContext <DSuiteContext>(); for (int i = 0; i < NumberOfCars; ++i) { Car NewCar = GenerateCar(); await EFCrud.Create(db, NewCar); } }
public async Task CRUDUsingHelperClass() { Car newCar = GenerateCar(); // Demonstrate basic CRUD DSuiteContext db = DBContextFactory.GetDbContext <DSuiteContext>(); await EFCrud.Create(db, newCar); Car found = await EFCrud.GetByKey(db, newCar); EFCrud.Delete(db, found); }