Class QueryProviderHooks
Installs a persistence package's query steps (ApplyExpand and the other pluggable hooks) for the provider a queryable comes from, before the query filters use them.
public static class QueryProviderHooks
- Inheritance
-
QueryProviderHooks
- Inherited Members
Remarks
EntityQuery's hooks start out as no-ops: ApplyExpand
returns the queryable unchanged. Each persistence package plugs in its own - Entity Framework's
Include, NHibernate's post-processing - and used to do it only in its persistence
manager's static constructor, which runs when the first persistence manager is created: by a
Metadata request or a save. Until then a query's expand was silently ignored: 200, with
every expanded navigation empty. A Breeze client fetches metadata first and never noticed; any
other first caller after a restart (a script, Swagger UI, a test host) did.
The query filters call EnsureInstalled(IQueryable?) with the queryable an action returned. The queryable's provider says which package's hooks it needs; this loads that package and runs its installer once per provider. Breeze.Core references neither package, so they are found by name. A provider Breeze has no package for (LINQ to Objects, say) needs no hooks.
Methods
EnsureInstalled(IQueryable?)
Make sure the query hooks for queryable's provider are installed. Cheap
after the first call for a provider; safe to call on every query.
public static void EnsureInstalled(IQueryable? queryable)
Parameters
queryableIQueryableThe queryable an action returned; null does nothing.