Ejemplo n.º 1
0
        /// <summary>
        /// Returns the first record from the query result.
        /// </summary>
        /// <returns>depending on T, single value or all fields values from the first record</returns>
        public T Single <T>()
        {
            var res = new SingleDataReaderResult <T>(Read <T>);

            ExecuteReader(res, 1);
            return(res.Result);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Returns dictionary with first record values.
        /// </summary>
        /// <returns>dictionary with field values or null if query returns zero records.</returns>
        public Dictionary <string, object> ToDictionary()
        {
            var res = new SingleDataReaderResult <Dictionary <string, object> >(ReadDictionary);

            ExecuteReader(res, 1);
            return(res.Result);
        }
Ejemplo n.º 3
0
            /// <summary>
            /// Returns dictionary with first record values.
            /// </summary>
            /// <returns>dictionary with field values or null if query returns zero records.</returns>
            public Dictionary <string, object> ToDictionary()
            {
                var res = new SingleDataReaderResult <Dictionary <string, object> >(ReadDictionary);

                using (var selectCmd = GetSelectCmd()) {
                    DataHelper.ExecuteReader(selectCmd, CommandBehavior.SingleRow, DataReaderRecordOffset, 1, res);
                }
                return(res.Result);
            }
Ejemplo n.º 4
0
            /// <summary>
            /// Returns the first record from the query result.
            /// </summary>
            /// <returns>depending on T, single value or all fields values from the first record</returns>
            public T Single <T>()
            {
                var res = new SingleDataReaderResult <T>(Read <T>);

                using (var selectCmd = GetSelectCmd()) {
                    DataHelper.ExecuteReader(selectCmd, CommandBehavior.SingleRow, DataReaderRecordOffset, 1, res);
                }
                return(res.Result);
            }