/// <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); }
/// <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); }