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)); }
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)); }