public EfGenericRepository(TeleimotDbContext context)
        {
            if (context == null)
            {
                throw new ArgumentException("An instance of DbContext is required to use this repository.", "context");
            }

            this.Context = context;
            this.DbSet   = this.Context.Set <T>();
        }
示例#2
0
        public static void Initialize()
        {
            Database.SetInitializer(new MigrateDatabaseToLatestVersion <TeleimotDbContext, Configuration>());

            TeleimotDbContext.Create().Database.Initialize(true);
        }
示例#3
0
 protected BaseService()
 {
     var db = new TeleimotDbContext();
     this.Users = new GenericRepository<User>(db);
 }
示例#4
0
        protected BaseService()
        {
            var db = new TeleimotDbContext();

            this.Users = new GenericRepository <User>(db);
        }