ArgumentException during query translation: ToString not declared on Nullable<int> #15386
Labels
closed-fixed
The issue has been fixed and is/will be included in the release indicated by the issue milestone.
customer-reported
type-bug
Milestone
Describe what is not working as expected:
Calling
ToString()
on a related object'sint
-typed column causes anArgumentException
. Doing the same for aGuid
-typed column works as expected.The primary object is an event log entry, and the related object is a (nullable) user with two identifiers - an
int
and aGuid
. RetrievingFromUser.ID.ToString()
causes the exception; callingFromUser.Guid.ToString()
does not.Full exception details (message and stack trace):
Steps to reproduce
The relevant parts of the model, in pseudo-code:
Code that triggers the exception:
These are trimmed-down examples, not the full code, so the exception above could be a bit misleading..
Further Notes
.Where(x => x != null)
before the finalSelect( ... ToString())
does not affect the outcome..Select(x => x != null ? x.ID.ToString() : null)
throws the exception too.Related Issues
Further technical details
EF Core version: 2.2.3, 2.2.4
Database Provider: Microsoft.EntityFrameworkCore.SqlServer, Microsoft.EntityFrameworkCore.Sqlite
Operating system: Windows 10
IDE: Visual Studio 2017 15.9
The text was updated successfully, but these errors were encountered: