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

Make SqlExpressionFactory.ApplyTypeMapping virtual #16550

Merged
merged 1 commit into from
Jul 10, 2019

Conversation

roji
Copy link
Member

@roji roji commented Jul 10, 2019

Providers can be expected to extend SqlExpressionFactory in order to facilitate creating custom SQL expressions. The ApplyTypeMapping in particular should be virtual to allow it to be overridden for those expressions. Other methods don't seem to require extensibility, but we can discuss.

Also did some C# 8 goodness.

{
if (sqlExpression == null
|| sqlExpression.TypeMapping != null)
{
return sqlExpression;
}

switch (sqlExpression)
return sqlExpression switch
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a side note:
We have no consensus on if we want to use switch expression everywhere. In certain cases, it seems useful but in other cases it also hinders readability. It will show up in design meeting at some point.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, no problem. I also don't think using them everywhere is a good idea - it's a case-by-case thing. Feel free to reject changes if you feel they're detrimental.

/cc @ajcvickers

@roji roji merged commit f614bff into master Jul 10, 2019
@ghost ghost deleted the SqlExpressionFactoryVirtual branch July 10, 2019 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants