private IFoodDeliveryDbContext CreateDbContext()
        {
            var options = new DbContextOptionsBuilder <FoodDeliveryDbContext>()
                          .UseInMemoryDatabase(databaseName: Guid.NewGuid().ToString())
                          .Options;
            var dbContext = new FoodDeliveryDbContext(options);

            dbContext.SaveChanges();
            return(dbContext);
        }
Example #2
0
 public void Commit()
 {
     _context.SaveChanges();
     //UserRepository.DbContext.SaveChanges();
 }