public UserCoreTest() { LoyaltyContext context = new LoyaltyContext(new DbContextOptionsBuilder <LoyaltyContext>() .UseInMemoryDatabase(databaseName: "Add_writes_to_database") .Options); core = new UserCore(context); }
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]"); } }
/// <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; }
public UserCore(LoyaltyContext context) { this.context = context; }
public WalletRepository(LoyaltyContext context) { _context = context ?? throw new ArgumentNullException(nameof(context)); }