• Basics
  • Abyss
  • Web APIs
  • C# & Razor
  • .net API
  • JS & TS API

    Show / Hide Table of Contents

    Class Query

    Provides a data-source to a query, but won't assemble/compile the query unless accessed (lazy).

    Inheritance
    System.Object
    ToSic.Lib.Services.ServiceBase
    ToSic.Lib.Services.ServiceBase<DataSource.MyServices>
    DataSource
    Query
    Implements
    IQuery
    IDataSource
    IDataSourceSource
    IAppIdentity
    IZoneIdentity
    IAppIdentityLight
    ICacheKey
    ICacheExpiring
    ITimestamped
    ICanPurgeListCache
    IHasLog
    IDataSourceTarget
    IDataSourceShared
    Inherited Members
    DataSource.Name
    DataSource.AppId
    DataSource.ZoneId
    DataSource.Guid
    DataSource.Error
    DataSource.CacheRelevantConfigurations
    DataSource.CachePartialKey
    DataSource.CacheFullKey
    DataSource.CacheTimestamp
    DataSource.CacheChanged(Int64)
    DataSource.MyConfiguration
    DataSource.Configuration
    DataSource.ConfigMask(String, String, Boolean)
    DataSource.In
    DataSource.TryGetIn(String)
    DataSource.Item[String]
    DataSource.GetStream(String, String, Boolean, Boolean)
    DataSource.List
    DataSource.Attach(IDataSource)
    DataSource.Attach(String, IDataSource, String)
    DataSource.Attach(String, IDataStream)
    DataSource.ProvideOut(Func<IEnumerable<IEntity>>, String)
    DataSource.ProvideOut(Func<IImmutableList<IEntity>>, String)
    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 Source

    Definition

    The underlying definition for the current query so you can check what's inside.

    Declaration
    public QueryDefinition Definition { get; }
    Property Value
    Type Description
    QueryDefinition
    | Improve this Doc View Source

    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
    DataSource.Out

    Methods

    | Improve this Doc View Source

    Params()

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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
    | Improve this Doc View Source

    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.

    | Improve this Doc View Source

    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
    DataSource.PurgeList(Boolean)
    | Improve this Doc View Source

    Reset()

    Reset the query, so it can be run again. Requires all params to be set again.

    Declaration
    public void Reset()

    Implements

    IQuery
    IDataSource
    IDataSourceSource
    IAppIdentity
    IZoneIdentity
    IAppIdentityLight
    ICacheKey
    ICacheExpiring
    ITimestamped
    ICanPurgeListCache
    IHasLog
    IDataSourceTarget
    IDataSourceShared
    • Improve this Doc
    • View Source
    Back to top Generated by DocFX