Beispiel #1
0
        protected GenericRepository()
        {
            var optionsBuilder = new DbContextOptionsBuilder <NexusRepository>();

            optionsBuilder.UseSqlServer("Server=LAPTOP-UU6RSPJM;Initial Catalog=whatrocks;Persist Security Info=False;Integrated Security=True;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=True;Connection Timeout=30;");
            db    = new NexusRepository(optionsBuilder.Options);
            dbSet = db.DbContext.Set <T>();
        }
Beispiel #2
0
 protected virtual void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (this.db != null)
         {
             this.db.Dispose();
             this.db = null;
         }
     }
 }