示例#1
0
        private void UpdateDatabase()
        {
            var optionsBuilder = new DbContextOptionsBuilder <BContext>();
            var options        =
                optionsBuilder
                .UseSqlite(Configuration.GetConnectionString("DefaultConnection"))
                .Options;

            using (var context = new BContext(options))
            {
                context.Database.Migrate();
            }
        }
示例#2
0
        public ModeloSeviceTest()
        {
            logger = new Mock <ILogger>();

            var mapperConfig = new MapperConfiguration(config =>
            {
                config.AddProfile <AutomapperConfig>();
            });

            mapperMemory = mapperConfig.CreateMapper();

            _contextMemory = InMemoryContextFactory.Create();

            this._notificadorMemory = new Notificador();

            this._repositoryMemory = new ModeloRepository(_contextMemory);
            this._serviceMemory    = new ModeloService(_notificadorMemory, _repositoryMemory, mapperMemory, logger.Object);

            ConfigInMemory();
        }
示例#3
0
 public ModeloRepository(Context.BContext db) : base(db)
 {
     _context = db;
 }
示例#4
0
 protected Repository(BContext db)
 {
     Db    = db;
     DbSet = db.Set <TEntity>();
 }
示例#5
0
 public CaminhaoRepository(Context.BContext db) : base(db)
 {
     _context = db;
 }