示例#1
0
        public static IEnumerable <TResult> Query <TSource, TResult>(this IEnumerable <TSource> enumerable, string sql)
        {
            Debug.Assert(enumerable != null);
            Debug.Assert(string.IsNullOrEmpty(sql) == false);

            EnumerableQuery <TSource, TResult> query = new EnumerableQuery <TSource, TResult>(sql);

            query.Compile();
            return(enumerable.Query <TSource, TResult>(query));
        }
示例#2
0
        public static IEnumerable <TResult> Query <TSource, TResult>(this IEnumerable <TSource> enumerable, EnumerableQuery <TSource, TResult> query)
        {
            Debug.Assert(enumerable != null);
            Debug.Assert(query != null);

            return(query.Evaluate(enumerable));
        }