예제 #1
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   An IDataReader extension method that last row asynchronous. </summary>
        ///
        /// <remarks>   Msacli, 22.04.2019. </remarks>
        ///
        /// <param name="dataReader">   The dataReader to act on. </param>
        ///
        /// <returns>   An asynchronous result that yields the last row. </returns>
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        public static Task <ExpandoObject> LastRowAsync(this IDataReader dataReader)
        {
            Task <ExpandoObject> resultTask = Task.Factory.StartNew(() =>
            {
                return(DataReaderExtensions.LastRow(dataReader));
            });

            return(resultTask);
        }
예제 #2
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>   Bind IDataReader content to ExpandoObject list. </summary>
        ///
        /// <remarks>   Msacli, 22.04.2019. </remarks>
        ///
        /// <param name="reader">       . </param>
        /// <param name="closeAtFinal"> (Optional) </param>
        ///
        /// <returns>   Returns ExpandoObject object list. </returns>
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        public static Task <List <ExpandoObject> > GetDynamicResultSetAsync(
            this IDataReader reader, bool closeAtFinal = false)
        {
            Task <List <ExpandoObject> > resultTask = Task.Factory.StartNew(() =>
            {
                return(DataReaderExtensions.GetDynamicResultSet(reader, closeAtFinal));
            });

            return(resultTask);
        }
예제 #3
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// An IDataReader extension method that gets multi dynamic result set asynchronous.
        /// </summary>
        ///
        /// <remarks>   Msacli, 22.04.2019. </remarks>
        ///
        /// <param name="reader">   . </param>
        ///
        /// <returns>   An asynchronous result that yields the multi dynamic result set. </returns>
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        public static Task <List <List <ExpandoObject> > > GetMultiDynamicResultSetAsync(
            this IDataReader reader)
        {
            Task <List <List <ExpandoObject> > > resultTask = Task.Factory.StartNew(() =>
            {
                return(DataReaderExtensions.GetMultiDynamicResultSet(reader));
            });

            return(resultTask);
        }
예제 #4
0
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        /// <summary>
        /// An IDataReader extension method that gets dynamic result set with paging asynchronous.
        /// </summary>
        ///
        /// <remarks>   Msacli, 22.04.2019. </remarks>
        ///
        /// <param name="reader">           . </param>
        /// <param name="pageNumber">       (Optional) The page number. </param>
        /// <param name="pageItemCount">    (Optional) Number of page ıtems. </param>
        /// <param name="closeAtFinal">     (Optional) </param>
        ///
        /// <returns>   An asynchronous result that yields the dynamic result set with paging. </returns>
        ////////////////////////////////////////////////////////////////////////////////////////////////////
        public static Task <List <ExpandoObject> > GetDynamicResultSetWithPagingAsync(this IDataReader reader,
                                                                                      uint pageNumber = 1, uint pageItemCount = 10, bool closeAtFinal = false)
        {
            Task <List <ExpandoObject> > resultTask = Task.Factory.StartNew(() =>
            {
                return(DataReaderExtensions.GetDynamicResultSetWithPaging(reader, pageNumber, pageItemCount, closeAtFinal));
            });

            return(resultTask);
        }