Пример #1
0
 public CompraServiceTestes()
 {
     _context = InMemoryContextFactory.Create();
     _revendedorRepository = new RevendedorRepository(_context);
     _revendedorService    = new RevendedorService(_revendedorRepository, null);
     _configuration        = InMemoryContextFactory.CreateConfiguration();
     _repository           = new CompraRepository(_context);
     _service = new CompraService(_configuration, _repository, _revendedorRepository, null);
 }
Пример #2
0
        private void UpdateDatabase(IApplicationBuilder app)
        {
            var optionsBuilder = new DbContextOptionsBuilder <BoticarioContext>();
            var options        = optionsBuilder.UseSqlServer(Configuration.GetConnectionString("Database")).Options;

            using (var context = new BoticarioContext(options))
            {
                context.Database.Migrate();
            }
        }
 public CompraRepository(BoticarioContext context) : base(context)
 {
     _context = context;
 }
 public RevendedorRepository(BoticarioContext context) : base(context)
 {
     _context = context;
 }
 public RevendedorServiceTestes()
 {
     _context    = InMemoryContextFactory.Create();
     _repository = new RevendedorRepository(_context);
     _service    = new RevendedorService(_repository, null);
 }