Class Query
- Namespace
- ToSic.Eav.DataSource.Query.Sys
- Assembly
- ToSic.Eav.DataSource.dll
Provides a Query as a data-source.
[InternalApi_DoNotUse_MayChangeWithoutNotice]
public class Query : DataSourceBase, IQuery, IDataSource, IDataSourceLinkable, IAppIdentity, IZoneIdentity, IAppIdentityLight, ICacheKey, ICacheExpiring, ITimestamped, IHasLog
- Inheritance
-
objectQuery
- Implements
- Inherited Members
Remarks
Note that this source provides access to the query, but it won't run unless you access the data.
Properties
Definition
The underlying definition for the current query so you can check what's inside.
public QueryDefinition Definition { get; }
Property Value
In
All In connections, read-only.
public override IReadOnlyDictionary<string, IDataStream> In { get; }
Property Value
- IReadOnlyDictionary<string, IDataStream>
A dictionary of named IDataStream objects, case-insensitive
Out
Standard out. Note that the Out is not prepared until accessed the first time, when it will auto-assembles the query
public override IReadOnlyDictionary<string, IDataStream> Out { get; }
Property Value
Methods
Params()
Get the current list of params.
public IDictionary<string, string> Params()
Returns
- IDictionary<string, 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.
public void Params(IDictionary<string, string> values)
Parameters
valuesIDictionary<string, string>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.
public void Params(string list)
Parameters
liststringlist 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.
public void Params(string key, object? value)
Parameters
keystringKey - the part used in [Params:key]
valueobjectThe 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.
public void Params(string key, string? value)
Parameters
keystringKey - the part used in [Params:key]
valuestringThe 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.