public RepositoryBase(IDataBaseFactory Factory) { ctx = Factory.DataContext; dbset = ctx.Set <T>(); }
public Repository(Model1 db) { this.db = db; this.table = db.Set <T>(); }
public void UpdateEntity(T entity) { db.Set <T>().AddOrUpdate(entity); db.SaveChanges(); }
public BaseRepository() { db = new Model1(); dbSet = db.Set <T>(); }
public Repository() { this.db = new Model1(); this.table = db.Set <T>(); }
public List <User> List() { Model1 ctx = new Model1(); return(ctx.Set <User>().ToList()); }
public virtual List <Leave> GetByName(string tj) { Model1 db = new Model1(); return(db.Set <Leave>().Where(x => x.User.UserName == tj).ToList()); }
public void Create(T item) { db.Set <T>().Add(item); }
public Comment Find(int id) { Model1 ctx = new Model1(); return(ctx.Set <Comment>().Find(id)); }
public GenericRepository(Model1 context) { this.context = context; this.dbSet = context.Set <ExampleDataModelo>(); }
public IDbSet <T> DbSet() { return(_dbContext.Set <T>()); }
public virtual List <T> GetAll() { return(db.Set <T>().ToList()); }
public Repository() { db = new Model1(); table = db.Set <T>(); }
public BaseRepository(Model1 db) { this.db = db; dbSet = db.Set <T>(); }
public BaseRepository() { dbSet = dbcontext.Set <TEntity>();//构造一个实体集 }
public List <Comment> List() { Model1 ctx = new Model1(); return(ctx.Set <Comment>().ToList()); }
public User Find(int id) { Model1 ctx = new Model1(); return(ctx.Set <User>().Find(id)); }
public RepositoryBase(Model1 _ctx) { _set = _ctx.Set <TEntity>(); }
public virtual List <Leave> GetByother(string tj) { Model1 db = new Model1(); return(db.Set <Leave>().Where(x => x.LeaveOver != tj).ToList()); }
public virtual int Count(Expression <Func <T, bool> > predicate) { return(dbEF.Set <T>().AsNoTracking().Count(predicate)); }
public virtual List <Leave> GetBySomeother(string tj, string tj2) { Model1 db = new Model1(); return(db.Set <Leave>().Where(x => x.LeaveOver == tj && x.Leave_Condition == tj2).ToList()); }
public GenericRepository(Model1 context) { this.context = context; this.dbSet = context.Set <TEntity>(); }