Exemplo n.º 1
0
        /// <summary>
        /// Returns the number of the rows returned by a semantic query.
        /// </summary>
        /// <typeparam name="T">The type of the subject node.</typeparam>
        /// <param name="prev">Is a subject node.</param>
        public static int CountGo <T>(this DbTable <T> prev)
            where T : DbRow
        {
            prev.CheckNullAndThrow(Text.Free.Sentence, Text.Method.SelectCount);
            var ca          = Assembly.GetCallingAssembly();
            var select      = new SelectChainer((ISemantic)prev, new Column[] { Designer.Count().As(Text.Count) }, false);
            var connectable = Reader.GetConnectable(ca, select);

            return(Reader.LoadTable <Row <int> >(connectable, null).ToValue <int>());
        }
Exemplo n.º 2
0
 /// <summary>
 /// Retrieves the number of rows returned by the query.
 /// </summary>
 /// <param name="prev">A predecessor object.</param>
 public static SelectChainer SelectCount(this ISemqToSql prev)
 {
     prev.CheckNullAndThrow(Text.Free.Sentence, Text.Method.SelectCount);
     return(new SelectChainer((ISemantic)prev, new Column[] { Designer.Count().As(Text.Count) }, false));
 }
Exemplo n.º 3
0
 /// <summary>
 /// <para>Retrieves the number of rows returned by the query.</para>
 /// </summary>
 /// <param name="prev">A predecessor object.</param>
 public static SelectChainer SelectCount(this ISelect prev)
 {
     return(new SelectChainer((Chainer)prev, new Column[] { Designer.Count().As(Text.Count) }, false));
 }