Repository navigation
Update the plugin model for expression filters - #581
Conversation
- Introduces a composite expression filter. - Pushes full-text search filtering into a specific filter. - Adds xml docs throughout.
roji
left a comment
There was a problem hiding this comment.
Looks good, see my comments before merging please.
| /// <inheritdoc /> | ||
| public NpgsqlCompositeEvaluatableExpressionFilter([NotNull] IModel model, [NotNull] INpgsqlOptions npgsqlOptions) : base(model) | ||
| { | ||
| var versionDependentFilters = |
There was a problem hiding this comment.
I'm not so sure this makes sense here, let's add it if we ever actually need it?
| node.Method.DeclaringType != typeof(NpgsqlFullTextSearchDbFunctionsExtensions) && | ||
| node.Method.DeclaringType != typeof(NpgsqlFullTextSearchLinqExtensions); | ||
|
|
||
| bool IEvaluatableExpressionFilter.IsEvaluatableBinary(BinaryExpression node) => true; |
There was a problem hiding this comment.
This is a bit unfortunate, in the future we can introduce an abstract base class which takes care of all of these, and leaves only IsEvaluatableMethodCall(), which is likely to be the only interesting one. But it's OK for now.
There was a problem hiding this comment.
We'll also need IsEvaluatableMember() in #577, but agreed that the interface feels...a bit busy.
There is actually a class that exposes just these two methods, but it currently resides in Microsoft.EntityFrameworkCore.Query.Internal, so I opted for the interface for the time being.
There was a problem hiding this comment.
That class also contains more concrete logic (DateTime.Now, GUIDs...).
However, there's EvaluatableExpressionFilterBasein relinq which seems to be exactly what you need, maybe just inherit that?
There was a problem hiding this comment.
I looked at that too... but one of the items mentioned here gave me pause:
Decide on architecture changes, if any. For example internalize or remove Relinq.
There was a problem hiding this comment.
OK, no big deal, we can always improve on this later if we want.
There was a problem hiding this comment.
One additional thought: EF Core themselves extend that class, so any breakage at the relinq side will surely be well thought-out :)
Split from #577