Interface IQuery
- Namespace
 - ToSic.Eav.DataSource
 
- Assembly
 - ToSic.Eav.DataSource.dll
 
Marks a special IDataSource which is a query. It has an underlying ToSic.Eav.DataSource.Sys.Query.QueryDefinition and Params which can be modified by code before running the query.
[PublicApi]
public interface IQuery : IDataSource, IDataSourceLinkable, IAppIdentity, IZoneIdentity, IAppIdentityLight, ICacheKey, ICacheExpiring, ITimestamped, IHasLog
  - Inherited Members
 
Properties
Definition
The underlying definition for the current query so you can check what's inside.
QueryDefinition Definition { get; }
  Property Value
- QueryDefinition
 
Methods
Params()
Get the current list of params.
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.
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.
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.
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.
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.