Beispiel #1
0
        public UserCoreTest()
        {
            LoyaltyContext context = new LoyaltyContext(new DbContextOptionsBuilder <LoyaltyContext>()
                                                        .UseInMemoryDatabase(databaseName: "Add_writes_to_database")
                                                        .Options);

            core = new UserCore(context);
        }
Beispiel #2
0
 public void Dispose()
 {
     using (var db = new LoyaltyContext())
     {
         db.Database.ExecuteSqlCommand("DELETE FROM [SpecialOfferings]");
         db.Database.ExecuteSqlCommand("DELETE FROM [Products]");
         db.Database.ExecuteSqlCommand("DELETE FROM [Customers]");
     }
 }
Beispiel #3
0
 /// <summary>
 /// Initializes a new instance of the <see cref="CustomerStore"/> class.
 /// </summary>
 /// <param name="users">The users.</param>
 public CustomerStore(Microsoft.EntityFrameworkCore.DbContextOptions <LoyaltyContext> options)
 {
     _context = new LoyaltyContext(options);
 }
 public TransferCore(LoyaltyContext context, UserCore userCore)
 {
     this.context  = context;
     this.userCore = userCore;
 }
Beispiel #5
0
 public UserCore(LoyaltyContext context)
 {
     this.context = context;
 }
 public WalletRepository(LoyaltyContext context)
 {
     _context = context ?? throw new ArgumentNullException(nameof(context));
 }