public static CoffeeMachineDbContext Create()
        {
            var options = new DbContextOptionsBuilder <CoffeeMachineDbContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString())
                          .Options;

            var context = new CoffeeMachineDbContext(options);

            context.Database.EnsureCreated();

            context.DrinkType.AddRange(new[] {
                new DrinkType {
                    DrinkTypeId = 1, DrinkTypeName = "Tea", Description = "Fresh And Juicy Tea....."
                },
                new DrinkType {
                    DrinkTypeId = 2, DrinkTypeName = "Chocolate Tea", Description = "Fresh Chocolate..."
                },
                new DrinkType {
                    DrinkTypeId = 3, DrinkTypeName = "Coffee", Description = " Yummy Coffeee with Good Taste"
                },
            });


            context.SaveChanges();

            return(context);
        }
예제 #2
0
 public CoffeeRepository(CoffeeMachineDbContext dbContext)
     : base(dbContext)
 {
 }
예제 #3
0
 public UnitOfWork(CoffeeMachineDbContext entities)
 {
     this._entities = entities;
 }
 public CreateOrderBadgeLastOrderCommand(CoffeeMachineDbContext context)
 {
     _context = context;
 }
 public IngredientRepository(CoffeeMachineDbContext dbContext, IBaseRepository <Ingredient> repo)
     : base(dbContext)
 {
     this.repo = repo;
 }
        public static void Destroy(CoffeeMachineDbContext context)
        {
            context.Database.EnsureDeleted();

            context.Dispose();
        }
예제 #7
0
 public CoffeeController(CoffeeMachineDbContext context)
 {
     _context = context;
 }
예제 #8
0
 public GetDrinkTypeAllQuery(CoffeeMachineDbContext context)
 {
     _context = context;
 }
 public GetBadgeLastOrderQuery(CoffeeMachineDbContext context)
 {
     _context = context;
 }
 public GetBadgeLastOrderQueryTest()
 {
     _context = CoffeeMachineContextFactory.Create();
 }
예제 #11
0
 public BaseRepository(CoffeeMachineDbContext dbContext)
 {
     this.dbContext = dbContext;
 }