-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Self-contained type mappings #7434
Comments
Note: discussed with @ajcvickers and the previous comment means just SQL literals (not C# literals) for now. |
Note to providers: there may be more changes in this area coming - I will post here when it's safe to go ahead and develop based on the changes. |
Further note to providers: with #8631 and #8678, most of the work for individual TypeMappings is in place. In #8668 we are still considering removing |
@ajcvickers I'd like to do it all, but I thought we were out of time for preview2? I don't have anything small I can just get in today. Would definitely like to do the C# literals in 2.0.0. |
@ajcvickers @divega OK. I haven't seen the design - is it consistent with the planned approach here to make TypeMappings self-contained? Or are we abandoning that approach - at least as far as the C# literals are concerned? If either of those is true then we can close this, unless @divega has any objections? |
Planned approach is to add method to RelationalTypeMapping with a fallback. It is consistent with what we have already done. |
OK. I imagine that would mean the removal of the:
methods in |
Preview2 is the last release to get feature work in for 2.0. (Other than small tweaks or exceptions for super-critical changes.) |
Ah, OK - thought we were going to have a preview3. Never mind then. |
@lajones I talked to @bricelam and @ajcvickers. I don't have any additional concerns with punting C# literals post 2.0. I am thinking it would be probably be better to capture any outstanding work into new issues rather than keeping this issue open. Could you please help with that? |
#8656 covers the issue about finding a more general way for query to deal with generating literals for a type which may not have a TypeMapping in a given provider. #1671 covers combining |
@lajones, @ajcvicers @bricelam I have closed #8656 as fixed (we did remove the pseudo-type mapping for char) and added text to #242 to cover the ideas for mapping char to string. Would #1671 only require minimal changes to represent the plan for C# literals or is it orthogonal? I think it would be good if someone with a good understanding of the plan (@bricelam?) filled the details there. After that, I think this issue can be closed as fixed. |
It's mostly orthogonal to #1671. If we don't de-dupe, we'll just have two entry points for generating C# literals that do the same thing (like we do today). |
@bricelam understood. Cleared up the milestone to get more clarity in triage on Monday on how to proceed. |
@bricelam to write the issue for C# literals. |
Filed #8741 |
Adding support for a new type on a relational database provider currently requires making changes in a few places:
IRelationalTypeMapper
: used to populate parameters, configure column facets, etc.ISqlGenerationHelper
: used to generate literal values for a given type in SQLCSharpUtilities
inMicrosoft.EntityFrameworkCore.Relational.Design
(and the equivalent types in migrations) to generate C# literals for the type... and maybe other things I am missing.
This issue is about refactoring our code to get closer to a situation in which a type mapping can convey the necessary knowledge to perform all or most of those responsibilities for a given type, so that the type mapping can be added to the provider's type mapper and no further actions are required to support the new type.
We should take into account:
ScaffoldingTypeMappper
in scaffolding.The text was updated successfully, but these errors were encountered: