public override async Task <int> GoAsync()
        {
            if (string.IsNullOrWhiteSpace(Sql))
            {
                throw new MissingSqlException();
            }
            var num = await StatementExecutor.ExecuteNonQueryAsync(Sql);

            return(num);
        }
Esempio n. 2
0
        public override async Task <TEntity> GoAsync()
        {
            if (IsAutoIncrement)
            {
                using (var reader = await StatementExecutor.ExecuteReaderAsync(Sql()))
                {
                    return(EntityMapper.Map <TEntity>(reader).FirstOrDefault());
                }
            }

            var num = await StatementExecutor.ExecuteNonQueryAsync(Sql());

            return(entity);
        }
Esempio n. 3
0
        public override async Task <TEntity> GoAsync()
        {
            if (IsAutoIncrement)
            {
                IDataReader dataReader = await StatementExecutor.ExecuteReaderAsync(Sql());

                IDataReader reader = dataReader;
                dataReader = null;
                try
                {
                    return(EntityMapper.Map <TEntity>(reader).FirstOrDefault());
                }
                finally
                {
                    reader?.Dispose();
                }
            }

            int num = await StatementExecutor.ExecuteNonQueryAsync(Sql());

            return(entity);
        }
        public override async Task <int> GoAsync()
        {
            int num = await StatementExecutor.ExecuteNonQueryAsync(Sql());

            return(num);
        }
 public override async Task <int> GoAsync()
 {
     var(item1, item2) = ParamSqlWithEntity();
     return(await StatementExecutor.ExecuteNonQueryAsync(item1, item2));
 }