예제 #1
0
        /// <summary>
        /// Gets stored procedure result.
        /// </summary>
        /// <typeparam name="TEntity">Type of entity.</typeparam>
        /// <typeparam name="TResult">Type of result.</typeparam>
        /// <param name="name">name of stored procedure</param>
        /// <param name="parameters">parameters of stored procedure</param>
        /// <param name="storedProcedureReturnData">stored procedure return data type</param>
        /// <returns>result</returns>
        private async Task <TResult> GetSpResult <TEntity, TResult>(
            string name,
            IEnumerable <KeyValuePair <string, object> > parameters,
            StoredProcedureReturnData storedProcedureReturnData)
            where TEntity : class
        {
            var sp       = SpHelper.CreateSp(name, parameters, storedProcedureReturnData);
            var dbResult = await this.ExecuteAsync <TEntity>(sp);

            var result = SpHelper.GetResult <TResult>(dbResult);

            return(result);
        }