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
@AndriySvyryd This is something I have been thinking about a lot, especially in relation to #31866, where the model types are not only in the cache key, but also in the compiled delegate. The reason we haven't done that before is that these things depend on both the model and the current internal service provider. So storing these things in the model is problematic when the same model is used with multiple different context types, or even different context configuration for the same context type. Maybe we need to give the service provider a key, like we gave the model a key in the previous PR? Thoughts?
@ajcvickers For the same model to be used with different internal service providers the user must call UseModel or UseInternalServiceProvider. And all usages should be with the same provider. So, for the cache to cause any issues one of the services that provide the cached values should've been replaced explicitly with different implementations on different contexts.
It seems like a very corner case, but if you want to provide a better exception if someone does get into this case we could store the internal service provider cache key on the model and when a new context is initialized log a warning if the stored key doesn't match the current key.
Related to #31539
Same for
EntityMaterializerSource
The text was updated successfully, but these errors were encountered: