Table of Contents

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
object
Query
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

QueryDefinition

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

IReadOnlyDictionary<string, IDataStream>

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

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.

public 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.

public 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.

public 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.