You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
varreportStates=reportTransaction.Query<ReportState>().Where("CorrelationId IN @reportGuids").OrderBy(x =>x.CorrelationId).Parameter("reportGuids",reportGuids).ToList().ToDictionary(x =>x.CorrelationId);
Expected
Query should return list of ReportState correctly populated with data.
Actual
Empty list is returned.
Workaround
Update JSON column with '{}'
It should either throw if JSON is nullable, or handle NULL values as empty objects.
The text was updated successfully, but these errors were encountered:
I agree with your 'Expected' assertion. However, what if the type has no default constructor?
How's this for a proposal:
If the type has a parameterless constructor, and the JSON is empty/null, new() it up
If the type doesn't have a parameterless constructor, and the JSON is null/empty, throw
Let me know what you think.
I think it will just require a change to DocumentReaderContext.cs so that when told to deserialize, instead of returning null/ignoring, it calls the constructor or throws. Alternatively, we might need to change the generated code so that it does the null check and calls the constructor that way.
Use case: migrate existing table/entity to Nevermore.
When adding a JSON column as NULLable, and it contains NULL, no properties are deserialized, not even column-bound properties.
Query
Expected
Query should return list of ReportState correctly populated with data.
Actual
Empty list is returned.
Workaround
Update JSON column with '{}'
It should either throw if JSON is nullable, or handle NULL values as empty objects.
The text was updated successfully, but these errors were encountered: