Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow TypeMappingSource to use the pre-convention configuration #25084

Closed
AndriySvyryd opened this issue Jun 12, 2021 · 1 comment · Fixed by #25540
Closed

Allow TypeMappingSource to use the pre-convention configuration #25084

AndriySvyryd opened this issue Jun 12, 2021 · 1 comment · Fixed by #25540
Labels
area-type-mapping closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Milestone

Comments

@AndriySvyryd
Copy link
Member

AndriySvyryd commented Jun 12, 2021

Splitting this out from #10784 (comment):

Ideally, TypeMappingSource would return the correct mapping for a given type after this change. However, the correct mapping will now depend on the model, or at least some part of the model. This is problematic because TypeMappingSource is a singleton service and is used extensively by other singleton services. Changing these all to scoped is not feasible. Two ways I can think of that might work are:

  • Passing in the model whenever we ask for a type mapping from the source. This requires non-trivial flow of the model to places it isn't now.
  • Have the source return some kind of deferred mapping, which is only later resolved to the real mapping when the model is available. I've been experimenting with this and it seems promising, but it is again not a trivial change.
@AndriySvyryd
Copy link
Member Author

We'll also need to

  • Add IMappingConfiguration? FindMappingConfiguration(Type type) method to IModel
  • Implement IMappingConfiguration in PropertyConfiguration
  • Add runtime implementation RuntimeMappingConfiguration
  • Add compiled model generation support

@AndriySvyryd AndriySvyryd added the closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. label Aug 16, 2021
@AndriySvyryd AndriySvyryd removed their assignment Aug 16, 2021
@ghost ghost closed this as completed in #25540 Aug 17, 2021
@ajcvickers ajcvickers modified the milestones: 6.0.0, 6.0.0-rc1 Aug 18, 2021
@ajcvickers ajcvickers modified the milestones: 6.0.0-rc1, 6.0.0 Nov 8, 2021
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-type-mapping closed-fixed The issue has been fixed and is/will be included in the release indicated by the issue milestone. type-enhancement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants