//public bool IsExist<T>(Expression<Func<T, bool>> exp) where T : class //{ // return _context.Set<T>().Any(exp); //} /// <summary> /// 查找单个 /// </summary> public T FindSingle <T>(Expression <Func <T, bool> > exp) where T : class { return(_context.Set <T>().AsNoTracking().FirstOrDefault(exp)); }
public bool IsExist(Expression <Func <T, bool> > exp) { return(_context.Set <T>().Any(exp)); }