Search Results for

    Show / Hide Table of Contents
    View Source

    Class SqlContext

    Implements ISqlContext.

    Inheritance
    object
    Namespace: Umbraco.Cms.Infrastructure.Persistence
    Assembly: Umbraco.Infrastructure.dll
    Syntax
    public class SqlContext : ISqlContext

    Constructors

    View Source

    SqlContext(ISqlSyntaxProvider, DatabaseType, IPocoDataFactory, IMapperCollection?)

    Initializes a new instance of the SqlContext class.

    Declaration
    public SqlContext(ISqlSyntaxProvider sqlSyntax, DatabaseType databaseType, IPocoDataFactory pocoDataFactory, IMapperCollection? mappers = null)
    Parameters
    Type Name Description
    ISqlSyntaxProvider sqlSyntax

    The sql syntax provider.

    DatabaseType databaseType

    The database type.

    IPocoDataFactory pocoDataFactory

    The Poco data factory.

    IMapperCollection mappers

    The mappers.

    Properties

    View Source

    DatabaseType

    Gets the database type.

    Declaration
    public DatabaseType DatabaseType { get; }
    Property Value
    Type Description
    DatabaseType
    View Source

    Mappers

    Gets the mappers.

    Declaration
    public IMapperCollection? Mappers { get; }
    Property Value
    Type Description
    IMapperCollection
    View Source

    PocoDataFactory

    Gets the Poco data factory.

    Declaration
    public IPocoDataFactory PocoDataFactory { get; }
    Property Value
    Type Description
    IPocoDataFactory
    View Source

    SqlSyntax

    Gets the Sql syntax provider.

    Declaration
    public ISqlSyntaxProvider SqlSyntax { get; }
    Property Value
    Type Description
    ISqlSyntaxProvider
    View Source

    Templates

    Gets the Sql templates.

    Declaration
    public SqlTemplates Templates { get; }
    Property Value
    Type Description
    SqlTemplates

    Methods

    View Source

    Query<T>()

    Creates a new query expression for the specified type T.

    Declaration
    public IQuery<T> Query<T>()
    Returns
    Type Description
    IQuery<T>

    A new query expression of type IQuery<T>.

    Type Parameters
    Name Description
    T

    The type of the entity to query.

    View Source

    Sql()

    Creates a new Sql expression.

    Declaration
    public Sql<ISqlContext> Sql()
    Returns
    Type Description
    Sql<ISqlContext>

    A new Sql expression.

    View Source

    Sql(string, params object[])

    Creates a new NPoco.Sql<> expression from the specified SQL string and arguments.

    Declaration
    public Sql<ISqlContext> Sql(string sql, params object[] args)
    Parameters
    Type Name Description
    string sql

    The SQL query string to create the expression from.

    object[] args

    The arguments to be used in the SQL query string.

    Returns
    Type Description
    Sql<ISqlContext>

    A new NPoco.Sql<> expression representing the specified SQL query.

    • View Source
    In this article
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX