We are using Entity Framework Core 8.0.1. We are storing the data as json in the database table columns. Below is a sample entity resembling the one we have:
Whenever I try to get data for this entity using something like this:
var myEntity = dbContext.MainEntity.FirstOrDefaultAsync();
It throws following error:
“Expression of type ‘System.Object’ cannot be used for assignment to type ‘System.Guid'”
However, if I do not include the related entity “RelatedEntity2” in the result, it works fine. Below is a snap showing members of class RelatedEntity2:
Can anyone please help?
Tried making the Guid type members non-nullable. Also, tried setting property access mode for the nullable Guid properties to “Property”. Bot didn’t work.
1