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
Currently when building property value expressions in the materializer, sometimes we must go through converter. Some of those converters capture constants "forbidden" in the AOT context. To avoid that, we use IProperty information to get the correct TypeMapping for that property, get converter from there and invoke the FromProvider delegate to get the final value.
However, if IProperty is not available, the only other way to get type mapping is from TypeMappingSource using CLR type as key. This is no reliable - multiple type mappings could be associated with the given CLR type key and we just get the default one.
What we do now is, if we don't have IProperty available, we peek into the converter FromProviderExpression and only if that captures a forbidden object we fallback to TypeMappingSource, otherwise we incorporate the lambda directly without going through TypeMapping.
Ideally we want to be consistent here, always have the right type mapping available. So we should always have IProperty when the type mapping is not the default.