Exemple #1
0
        public AlintaDbFixture()
        {
            var options = new DbContextOptionsBuilder <AlintaContext>().UseInMemoryDatabase("alinta-test").Options;

            Context = new AlintaContext(options);
            Context.Database.EnsureCreated();
        }
        public QueryTestFixture()
        {
            var options = new DbContextOptionsBuilder <AlintaContext>()
                          .UseInMemoryDatabase(Guid.NewGuid().ToString())
                          .Options;

            Context = new AlintaContext(options);

            Context.Database.EnsureCreated();

            Context.Customers.AddRange(new[] {
                new Customer("Adam", "Levine", new DateTime(1990, 1, 1)),
                new Customer("Sean", "Bean", new DateTime(1970, 11, 11)),
                new Customer("Adam", "Lambert", new DateTime(1980, 5, 5)),
            });

            Context.SaveChanges();
        }
 public GenericRepository(AlintaContext context)
 {
     this._DbContext = context;
     this._DbSet     = this._DbContext.Set <TEntity>();
 }
Exemple #4
0
 public UnitOfWork(AlintaContext context, ICustomerRepository carRepository)
 {
     this._DbContext         = context;
     this.CustomerRepository = carRepository;
 }
 public DeleteCustomerCommandHandler(AlintaContext context)
 {
     _context = context;
 }
Exemple #6
0
 public SearchCustomersQueryHandler(AlintaContext context)
 {
     _context = context;
 }
 public CustomerRepository(AlintaContext context)
 {
     _context = context;
 }
Exemple #8
0
 public UnitOfWork(AlintaContext context)
 {
     Context = context;
 }
 public SearchCustomersQueryHandlerTests(QueryTestFixture fixture)
 {
     _context = fixture.Context;
 }