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, all intrinsic types are handled by ICSharpHelper (or ICSharpUtilities for RevEng), and if we encounter a type we don't understand, we'll throw.
Instead of throwing, we should ask the provider if they know how to generate a literal for the type. We'll do this by adding a method similar to the following to RelationalTypeMapping.
language will probably be the file extension of the code file we're generating (e.g. .cs for C#).
If a value is returned, we'll use it. If null is returned we'll continue to error with unknown literal.
Optionally, we could move the existing literal generation code to the type mappings so that they become the source of truth for all literal generation.
If an application wanted to support literal generation for a new language (e.g. Visual Basic or F#), they could override the provider type mapping implementation to handle that language.
@bricelam thanks for writing this down. Question: do you envision the language parameter also in the methods of the "built-in" literal generation code (i.e. what currently lives in ICSharpHelp and ICSharpUtilities)? Perhaps it is ok to punt altogether on the multi-language support, but it might be relevant since you are working on #1671.
Activity
divega commentedon Jun 6, 2017
@bricelam thanks for writing this down. Question: do you envision the
languageparameter also in the methods of the "built-in" literal generation code (i.e. what currently lives inICSharpHelpandICSharpUtilities)? Perhaps it is ok to punt altogether on the multi-language support, but it might be relevant since you are working on #1671.divega commentedon Jun 6, 2017
@bricelam I guess I am just being skeptical about the
languageparameter approach. Nothing to worry about in the short term.ajcvickers commentedon Aug 13, 2018
See also #12979.
Removing this from backlog to see if we want to do this in 3.0, where we may be able to break if it becomes necessary.
Scaffold NTS literals for in model snapshot
Spatial types literal generation for SQLite snapshots
Scaffold NTS literals for in model snapshot
Spatial types literal generation for SQLite snapshots
Finishing up spatial literal generation for 2.2
Finishing up spatial literal generation for 2.2