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
I realise global query filters exist, but that’s difficult to use when validating complex business rules, because they can’t become a valid SQL query, so this won’t work for me.
Instead, I’d like to have a filter step I can hook into after the entity was hydrated from the query but before it’s returned to the caller.
At that point I could run complex business logic to perform validations and either filter the result or throw an exception.
The text was updated successfully, but these errors were encountered:
@Plasma We have investigated such an interception point before and run into two main problems. First, calling this after each entity instance is materialized, which is something we plan to do, (see #15911) but this isn't very useful for graph processing since related entities will not yet have been loading. Pushing this even further out is problematic because EF Core doesn't control how the application consumes LINQ queries. Second, picking apart a constructed graph of entities while maintaining integrity of the graph (and tracking) is non trivial, and not something we want to encourage.
Generally the application has a better understanding of when a query is finished and so it would be better to implement this event at the application level.
Hi,
I realise global query filters exist, but that’s difficult to use when validating complex business rules, because they can’t become a valid SQL query, so this won’t work for me.
Instead, I’d like to have a filter step I can hook into after the entity was hydrated from the query but before it’s returned to the caller.
At that point I could run complex business logic to perform validations and either filter the result or throw an exception.
The text was updated successfully, but these errors were encountered: