Beispiel #1
0
        public static TResult QueryScalar <TSource, TResult>(this IEnumerable <TSource> enumerable, string sql)
        {
            Debug.Assert(enumerable != null);
            Debug.Assert(string.IsNullOrEmpty(sql) == false, "Sql cannot be empty");

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

            query.Compile();
            return(enumerable.QueryScalar <TSource, TResult>(query));
        }
Beispiel #2
0
        public static TResult QueryScalar <TSource, TResult>(this IEnumerable <TSource> enumerable, ScalarQuery <TSource, TResult> query)
        {
            Debug.Assert(enumerable != null);
            Debug.Assert(query != null);

            return(query.Evaluate(enumerable));
        }