Esempio n. 1
0
        /// <summary>
        /// Returns the number of rows matching the query.
        /// To execute this CqlScalar use <c>Execute()</c> method.
        /// </summary>
        /// <typeparam name="TSource">The type of the elements of source.</typeparam>
        /// <param name="source">The CqlQuery&lt;TSource&gt; to return the first element of.</param>
        /// <returns>A single result: the number of rows matching the query.</returns>
        public static CqlScalar <long> Count <TSource>(this CqlQuery <TSource> source)
        {
            var ret = new CqlScalar <long>(source.Expression, source.Table, source.StatementFactory, source.PocoData);

            source.CopyQueryPropertiesTo(ret);
            return(ret);
        }
        /// <summary>
        /// Returns the number of rows matching the query.
        /// To execute this CqlScalar use <c>Execute()</c> method.
        /// </summary>
        /// <typeparam name="TSource">The type of the elements of source.</typeparam>
        /// <param name="source">The CqlQuery&lt;TSource&gt; to return the first element of.</param>
        /// <returns>A single result: the number of rows matching the query.</returns>
        public static CqlScalar <long> Count <TSource>(this CqlQuery <TSource> source)
        {
            var ret = new CqlScalar <long>(source.Expression, source.Provider);

            source.CopyQueryPropertiesTo(ret);
            return(ret);
        }