/// <summary> /// 查找单个 /// </summary> public T FindSingle(System.Linq.Expressions.Expression <Func <T, bool> > exp) { using (var context = new KindeeDBContext()) { return(context.Set <T>().AsNoTracking().FirstOrDefault(exp)); } }
public IQueryable <T> Filter(System.Linq.Expressions.Expression <Func <T, bool> > exp) { using (var context = new KindeeDBContext()) { var dbSet = context.Set <T>().AsQueryable(); if (exp != null) { dbSet = dbSet.Where(exp); } return(dbSet); } }
public bool IsExist(System.Linq.Expressions.Expression <Func <T, bool> > exp) { using (var context = new KindeeDBContext()) { return(context.Set <T>().Any(exp)); } }