public void Test()
 {
     using (var db = new HumanResourcesDbContext())
     {
         IHumanResourcesRepository rep = new HumanResourcesRepository(db);
         var dep  = rep.GetTestDepartment();
         var deps = new GenericRepository <Department>(db).All();
     }
 }
        public void TestForGenericRepo()
        {
            var optionsBuilder = new DbContextOptionsBuilder();

            //optionsBuilder.UseInternalServiceProvider
            optionsBuilder.UseSqlServer("Server=.\\sasiad;Database=AdventureWorks2014;Trusted_Connection=True;");

            using (var db = new HumanResourcesDbContext())
            {
                var deps = new GenericRepository <Department>(db).All();
            }
        }
Example #3
0
 public HumanResourcesRepository(HumanResourcesDbContext context) : base(context)
 {
     _dbContext = context;
 }
 public PersonalRepository(HumanResourcesDbContext context) : base(context)
 {
 }