Class Query
Provides a data-source to a query, but won't assemble/compile the query unless accessed (lazy).
Inheritance
Implements
Inherited Members
Namespace: ToSic.Eav.DataSources.Queries
Assembly: ToSic.Eav.DataSources.dll
Syntax
[PublicApi_Stable_ForUseInYourCode]
public sealed class Query : DataSource, IAppIdentitySync, IQuery, IDataSource, IDataSourceSource, IAppIdentity, IZoneIdentity, IAppIdentityLight, ICacheInfo, ICacheKey, ICacheExpiring, ITimestamped, ICanPurgeListCache, IHasLog, IDataSourceTarget, IDataTarget, IDataSourceShared
Properties
| Improve this Doc View SourceDefinition
The underlying definition for the current query so you can check what's inside.
Declaration
public QueryDefinition Definition { get; }
Property Value
Type | Description |
---|---|
QueryDefinition |
Out
Standard out. Note that the Out is not prepared until accessed the first time, when it will auto-assembles the query
Declaration
public override IDictionary<string, IDataStream> Out { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.String, IDataStream> |
Overrides
Methods
| Improve this Doc View SourceParams()
Get the current list of params.
Declaration
public IDictionary<string, string> Params()
Returns
Type | Description |
---|---|
System.Collections.Generic.IDictionary<System.String, System.String> | The list of params as they are configured in this moment. |
Params(IDictionary<String, String>)
Add/Set a parameter for the query, which will be used by the [Params:Xxx] tokens.
Declaration
public void Params(IDictionary<string, string> values)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.IDictionary<System.String, System.String> | values | dictionary with values |
Remarks
If you set a param after accessing the query, an exception will occur unless you call Reset() first.
Params(String)
Add/Set a parameter for the query, which will be used by the [Params:Xxx] tokens.
Declaration
public void Params(string list)
Parameters
Type | Name | Description |
---|---|---|
System.String | list | list of key=value on many lines |
Remarks
If you set a param after accessing the query, an exception will occur unless you call Reset() first.
Params(String, Object)
Add/Set a parameter for the query, which will be used by the [Params:Xxx] tokens. Takes any value object and will simply ToString() it.
Declaration
public void Params(string key, object value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Key - the part used in [Params:key] |
System.Object | value | The value it will resolve to. Can also be another token. |
Remarks
- If you set a param after accessing the query, an exception will occur unless you call Reset() first.
- History: Added in v15
Params(String, String)
Add/Set a parameter for the query, which will be used by the [Params:Xxx] tokens.
Declaration
public void Params(string key, string value)
Parameters
Type | Name | Description |
---|---|---|
System.String | key | Key - the part used in [Params:key] |
System.String | value | The value it will resolve to. Can also be another token. |
Remarks
If you set a param after accessing the query, an exception will occur unless you call Reset() first.
PurgeList(Boolean)
Override PurgeList, because we don't really have In streams, unless we use parameters.
Declaration
public override void PurgeList(bool cascade = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | cascade |
Overrides
| Improve this Doc View SourceReset()
Reset the query, so it can be run again. Requires all params to be set again.
Declaration
public void Reset()