When I call await reader.GetFieldValueAsync<int?>(0) on a column that contains NULL, it throws InvalidCastException: Specified cast is not valid. instead of returning null.
The synchronous reader.GetFieldValue<int?>(0) on the same column returns null correctly. So GetFieldValueAsync is not handling Nullable<T> the same way as the sync path.
This blocks all of our async data-access code paths that read nullable integer columns.
When I call
await reader.GetFieldValueAsync<int?>(0)on a column that containsNULL, it throwsInvalidCastException: Specified cast is not valid.instead of returningnull.The synchronous
reader.GetFieldValue<int?>(0)on the same column returnsnullcorrectly. SoGetFieldValueAsyncis not handlingNullable<T>the same way as the sync path.This blocks all of our async data-access code paths that read nullable integer columns.