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 EvaluableExpressionFilter public #16776

Merged
merged 1 commit into from
Jul 26, 2019
Merged

Conversation

roji
Copy link
Member

@roji roji commented Jul 26, 2019

No description provided.

@smitpatel
Copy link
Member

Also delete EvaluatableExpressionFilterBase

@roji roji force-pushed the MakeEvaluableFilterPublic branch from 724cb65 to b35076b Compare July 26, 2019 20:00
@roji
Copy link
Member Author

roji commented Jul 26, 2019

Making a service public was more work than I thought... Also introduced dependency objects for both core and relational.

Copy link
Member

@smitpatel smitpatel left a comment

Choose a reason for hiding this comment

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

Deferring to @ajcvickers to finish review since there are dependencies now

/// </summary>
public IModel Model { get; }
}
}
Copy link
Member

Choose a reason for hiding this comment

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

With method?

Copy link
Member

Choose a reason for hiding this comment

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

@roji Follow the same pattern as for all existing dependency objects and add validation test--see https://github.com/aspnet/EntityFrameworkCore/blob/master/test/EFCore.Tests/ModelSourceDependenciesTest.cs

Copy link
Member Author

Choose a reason for hiding this comment

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

Added With method for Model and tests for both the core and relational dependencies (sorry, it's the first time I'm doing this).

Note that I added these because the API consistency tests told me too. I think there are various other cases of services without dependency objects (e.g. QueryContext accepts QueryContextDependencies, but RelationalQueryContext accepts additional parameters directly). We may want to do an extra pass for this.

Copy link
Member

Choose a reason for hiding this comment

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

@roji Dependency objects are needed primarily when "outsiders" need to call constructors, possible from a derived class. This is expected anytime we have a public service implementation since, as you know from API review, we typically make these public when we expect people to inherit. So that's why there is a API consistency rule for those.

There are other places where we have added similar objects, but sometimes with a lighter-weight pattern (although maybe all our dependency objects could be read-only structs?). If there are places where you can see there will be problems evolving the API without dependency objects, then we should review those.

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, thanks for the explanation.

It seems a bit odd for a core base class (e.g. QueryContext) to have dependencies but not for its subclass in relational - if no outsider is expected to extend, then we don't need the deps in core, and if they do, then we do need them on relational, no?

Apart from that I don't yet have a good-enough feel for which services are expected to be extended (again, QueryContext?). It's probably not a big deal in any case.

Copy link
Member

Choose a reason for hiding this comment

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

@roji Agreed that feels wrong. File an issue?

Copy link
Member Author

Choose a reason for hiding this comment

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

Opened #16788

@roji roji force-pushed the MakeEvaluableFilterPublic branch from b35076b to 0d69d40 Compare July 26, 2019 21:26
@roji roji merged commit 0c508f4 into master Jul 26, 2019
@ghost ghost deleted the MakeEvaluableFilterPublic branch July 26, 2019 21:57
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.

3 participants