Exemple #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();
            }
        }
Exemple #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();
        }
Exemple #3
0
 public ModeloRepository(Context.BContext db) : base(db)
 {
     _context = db;
 }
Exemple #4
0
 protected Repository(BContext db)
 {
     Db    = db;
     DbSet = db.Set <TEntity>();
 }
Exemple #5
0
 public CaminhaoRepository(Context.BContext db) : base(db)
 {
     _context = db;
 }