Example #1
0
        public static DbContext GetAlmacenContext()
        {
            DbContextOptions <AlmacenDbContext> options = new DbContextOptionsBuilder <AlmacenDbContext>()
                                                          .UseInMemoryDatabase(Guid.NewGuid().ToString())
                                                          .EnableSensitiveDataLogging()
                                                          .Options;
            var context = new AlmacenDbContext(options);

            context.Database.EnsureDeleted();
            //agregando datos

            context.SaveChanges();
            return(context);
        }
Example #2
0
        public BaseTest()
        {
            DbContextOptions <ApplicationDbContext> options = new DbContextOptionsBuilder <ApplicationDbContext>()
                                                              .UseInMemoryDatabase(Guid.NewGuid().ToString())
                                                              .EnableSensitiveDataLogging()
                                                              .Options;

            _db = new ApplicationDbContext(options);
            _db.Database.EnsureCreated();
            AddData();

            DbContextOptions <AlmacenDbContext> optionsAlmacen = new DbContextOptionsBuilder <AlmacenDbContext>()
                                                                 .UseInMemoryDatabase(Guid.NewGuid().ToString())
                                                                 .EnableSensitiveDataLogging()
                                                                 .Options;

            _dbAlmacen = new AlmacenDbContext(optionsAlmacen);

            _dbAlmacen.Database.EnsureCreated();
        }
Example #3
0
 public ProductRepository(AlmacenDbContext ctx)
 {
     context = ctx;
 }
Example #4
0
 public AprobacionEconomiaController(EconomiaDbContext context)
 {
     _context = context;
     _almacen = new AlmacenDbContext();
 }
Example #5
0
 public SolicitudesController(AmasBDbContext context)
 {
     _context = context;
     _almacen = new AlmacenDbContext();
 }
Example #6
0
 public EFOrderRepository(AlmacenDbContext ctx)
 {
     context = ctx;
 }