public void Dispose(IEntitiesDbContext context)
 {
     if (context != null)
     {
         context.Dispose();
     }
 }
        public BaseServerTest()
        {
            // Set up in-memory database
            _effortDatabaseStrategy = CreateTestStrategy();
            _context = _effortDatabaseStrategy.CreateContext();

            // Set up in-memory web server
            _server = TestServer.Create(builder => new TestStartup(_context)
                                        .Configuration(builder));
        }
        public void Dispose()
        {
            // dispose of the database and connection
            _effortDatabaseStrategy.Dispose(_context);
            _context = null;

            if (_server != null)
            {
                _server.Dispose();
            }
        }
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (_context != null)
         {
             _context.Dispose();
             _context = null;
         }
     }
 }
 public EntityRepository(IEntitiesDbContext dbContext)
 {
     this.DbContext = dbContext;
 }
Beispiel #6
0
 public TestStartup(IEntitiesDbContext context)
 {
     _context = context;
 }
 public GenericRepository(IEntitiesDbContext context)
 {
     _context = context;
     _dbSet   = _context.Set <T>();
 }
Beispiel #8
0
 public BaseUnitOfWork(DbContext dbContext)
 {
     m_DbContext    = new DbContextWrapper(dbContext);
     m_Repositories = new Hashtable();
 }
Beispiel #9
0
 public UnitOfWork(IEntitiesDbContext context)
 {
     _context = context;
 }