Пример #1
0
 public static Task <int> CountAsync <T>(this IQueryable <T> source)
 {
     if (IsInUnitTest)
     {
         return(Task.FromResult(source.Count()));
     }
     return(QE.CountAsync(source));
 }
        public static Task <int> CountAsync <T>(this IQueryable <T> source)
            where T : class
        {
            if (source is EntitySet <T> )
            {
                source = (source as EntitySet <T>).DbSet;
            }

            return(Extensions.CountAsync(source));
        }