示例#1
0
        /// <summary>
        /// aggregate function query
        /// </summary>
        /// <typeparam name="DT">data type</typeparam>
        /// <param name="query">query object</param>
        /// <returns>data</returns>
        async Task <DT> AggregateFunctionAsync <DT>(OperateType funcType, IQuery query)
        {
            ICommand cmd = RdbCommand.CreateNewCommand <T>(funcType);

            SetCommand(cmd, null);
            cmd.Query = query;
            DT obj = await WorkFactory.QuerySingleAsync <DT>(cmd).ConfigureAwait(false);

            return(obj);
        }
示例#2
0
        /// <summary>
        /// query data
        /// </summary>
        /// <param name="query">query object</param>
        /// <returns>data</returns>
        public virtual async Task <T> GetAsync(IQuery query)
        {
            ICommand cmd = RdbCommand.CreateNewCommand <T>(OperateType.Query);

            SetCommand(cmd, null);
            cmd.Query = query;
            T obj = await WorkFactory.QuerySingleAsync <T>(cmd).ConfigureAwait(false);

            return(obj);
        }