/// <summary> /// 获取集合 /// </summary> /// <param name="whereLambda"></param> /// <returns></returns> public IQueryable <T> ListModels(Expression <Func <T, bool> > whereLambda) { return(db.Set <T>().Where(whereLambda)); }
public IQueryable <T> LoadEntities(System.Linq.Expressions.Expression <Func <T, bool> > whereLambda) { return(db.Set <T>().Where <T>(whereLambda)); }
/// <summary> /// 获取实体 /// </summary> /// <returns></returns> public IQueryable <T> Get() { DbContext db = GetDbContext(); return(db.Set <T>()); }
public T Add(T entity) { // throw new NotImplementedException(); _Db.Set <T>().Add(entity); return(entity); }
public Repository(DbContext context) { Context = context; this.dbSet = Context.Set <TEntity>(); }