The AsyncAccessorDataReader never seems to take the Current value from the IAsyncEnumerator and set it's own Current value with it, when ReadAsync is called. This means that as soon as the SqlBulkCopy tries to get a value for the first row, it encounters a null value, triggering a NullReferenceException.
Where are you seeing this?
Dapper AOT 1.0.23
To Reproduce
IAsyncEnumerable<Customer> customers = ...
var reader = TypeAccessor.CreateDataReader(customers);
using var table = new SqlBulkCopy(connection);
table.EnableStreaming = true;
table.WriteToServer(TypeAccessor.CreateDataReader(customers,
[nameof(Customer.Name), nameof(Customer.CustomerNumber)]));
Describe the bug
The AsyncAccessorDataReader never seems to take the Current value from the IAsyncEnumerator and set it's own Current value with it, when ReadAsync is called. This means that as soon as the SqlBulkCopy tries to get a value for the first row, it encounters a null value, triggering a NullReferenceException.
Where are you seeing this?
To Reproduce