Example #1
0
        /// <summary>
        /// determine whether data is exist
        /// </summary>
        /// <param name="query">query object</param>
        /// <returns>whether data is exist</returns>
        public virtual async Task <bool> ExistAsync(IQuery query)
        {
            var cmd = RdbCommand.CreateNewCommand <T>(OperateType.Exist);

            SetCommand(cmd, null);
            cmd.MustReturnValueOnSuccess = true;
            cmd.Query             = query;
            cmd.CommandResultType = ExecuteCommandResult.ExecuteScalar;
            return(await WorkFactory.QueryAsync(cmd).ConfigureAwait(false));
        }
Example #2
0
        /// <summary>
        /// query data list
        /// </summary>
        /// <param name="query">query object</param>
        /// <returns>data list</returns>
        async Task <List <T> > QueryListAsync(IQuery query)
        {
            ICommand cmd = RdbCommand.CreateNewCommand <T>(OperateType.Query);

            SetCommand(cmd, null);
            cmd.Query = query;
            var objList = (await WorkFactory.QueryAsync <T>(cmd).ConfigureAwait(false)).ToList();

            return(objList);
        }