Пример #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();
        }
Пример #3
0
 public GenericRepository(AlintaContext context)
 {
     this._DbContext = context;
     this._DbSet     = this._DbContext.Set <TEntity>();
 }
Пример #4
0
 public UnitOfWork(AlintaContext context, ICustomerRepository carRepository)
 {
     this._DbContext         = context;
     this.CustomerRepository = carRepository;
 }
 public DeleteCustomerCommandHandler(AlintaContext context)
 {
     _context = context;
 }
Пример #6
0
 public SearchCustomersQueryHandler(AlintaContext context)
 {
     _context = context;
 }
Пример #7
0
 public CustomerRepository(AlintaContext context)
 {
     _context = context;
 }
Пример #8
0
 public UnitOfWork(AlintaContext context)
 {
     Context = context;
 }
 public SearchCustomersQueryHandlerTests(QueryTestFixture fixture)
 {
     _context = fixture.Context;
 }