Exemplo n.º 1
0
        //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));
        }
Exemplo n.º 2
0
 public bool IsExist(Expression <Func <T, bool> > exp)
 {
     return(_context.Set <T>().Any(exp));
 }