Table of Contents

Interface IQuery

Namespace
ToSic.Eav.DataSource
Assembly
ToSic.Eav.DataSources.dll

Marks a special IDataSource which is a query. It has an underlying 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

values IDictionary<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

list string

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.

void Params(string key, object value)

Parameters

key string

Key - the part used in [Params:key]

value object

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.

void Params(string key, string value)

Parameters

key string

Key - the part used in [Params:key]

value string

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.