Class QueryDefinitionFactory
- Namespace
- ToSic.Eav.DataSource.Query.Sys
- Assembly
- ToSic.Eav.DataSource.dll
Helper to build a QueryDefinition objects based on a query definition entity.
[InternalApi_DoNotUse_MayChangeWithoutNotice]
public class QueryDefinitionFactory : ServiceBase, IHasLog
- Inheritance
-
objectQueryDefinitionFactory
- Implements
- Inherited Members
Remarks
Made visible in the docs v21.02, but still just fyi/internal.
Constructors
QueryDefinitionFactory(DataSourceCatalog)
Helper to build a QueryDefinition objects based on a query definition entity.
public QueryDefinitionFactory(DataSourceCatalog dsCatalog)
Parameters
dsCatalogDataSourceCatalog
Remarks
Made visible in the docs v21.02, but still just fyi/internal.
Methods
Create(int, IEntity)
Create a QueryDefinition based on the given query definition entity.
public QueryDefinition Create(int appId, IEntity entity)
Parameters
appIdintThis is important, as the query definition can be in global apps, while running in another app context.
entityIEntity
Returns
Remarks
The entity should have the correct metadata and properties to be used as a query definition, otherwise this will fail. This is usually used to create a QueryDefinition from an entity stored in the database, but it can also be used to create a QueryDefinition from an entity created in memory (e.g. for testing purposes).