Closed bhood-zorus closed 10 months ago
That exception is thrown here.. Best to reproduce it in that repository. Consider making the member types match using ForMember
.
@BlaiseD Why does it work for int
/int?
but not uint
/uint?
? Perhaps I'm misunderstanding something, but your comment hasn't answered anything for me.
@BlaiseD I (hopefully) understand now that you were advising me to make the issue in that GitHub repository. I will do that.
Source/destination types
Mapping configuration
Version: 4.0.1
.NET 6 AutoMapper.AspNetCore.OData.EFCore 4.0.1 AutoMapper 12.0.1 AutoMapper.Collection 9.0.0 AutoMapper.Extensions.ExpressionMapping 6.0.4 AutoMapper.Extensions.DependencyInjection 12.0.1
Expected behavior
Results are returned normally
Actual behavior
Steps to reproduce
Sample project: https://github.com/bhood-zorus/AutoMapperBugDemo Send a GET request to
https://localhost:port/api/test?$filter=UserId eq 1
When the
UserId
property ofTestEntity
andTestModel
is of typeint
andint?
(respectively), the API request succeeds. When it's of an unsigned type (uint
,ulong
, etc.) the application throws the exception above.The sample project uses an in-memory database for the sake of providing a simple repro. This behavior is currently being seen with a real-world MySQL database using the Pomelo EF provider. The only way I've been able to reproduce this problem has been to use the
GetQueryAsync
extension method, so I assume this is the appropriate repository to report it in.