Search Results for

    Show / Hide Table of Contents
    View Source

    Class SqlContextExtensions

    Provides extension methods to ISqlContext.

    Inheritance
    System.Object
    Namespace: Umbraco.Extensions
    Assembly: Umbraco.Infrastructure.dll
    Syntax
    public static class SqlContextExtensions

    Methods

    View Source

    VisitDto<TDto>(ISqlContext, Expression<Func<TDto, Object>>, String)

    Visit an expression.

    Declaration
    public static (string Sql, object[] Args) VisitDto<TDto>(this ISqlContext sqlContext, Expression<Func<TDto, object>> expression, string alias = null)
    Parameters
    Type Name Description
    ISqlContext sqlContext

    An ISqlContext.

    System.Linq.Expressions.Expression<Func<TDto, System.Object>> expression

    An expression to visit.

    System.String alias

    An optional table alias.

    Returns
    Type Description
    System.ValueTuple<System.String, System.Object[]>

    A SQL statement, and arguments, corresponding to the expression.

    Type Parameters
    Name Description
    TDto

    The type of the DTO.

    View Source

    VisitDto<TDto1, TDto2>(ISqlContext, Expression<Func<TDto1, TDto2, Object>>, String, String)

    Visit an expression.

    Declaration
    public static (string Sql, object[] Args) VisitDto<TDto1, TDto2>(this ISqlContext sqlContext, Expression<Func<TDto1, TDto2, object>> expression, string alias1 = null, string alias2 = null)
    Parameters
    Type Name Description
    ISqlContext sqlContext

    An ISqlContext.

    System.Linq.Expressions.Expression<Func<TDto1, TDto2, System.Object>> expression

    An expression to visit.

    System.String alias1

    An optional table alias for the first DTO.

    System.String alias2

    An optional table alias for the second DTO.

    Returns
    Type Description
    System.ValueTuple<System.String, System.Object[]>

    A SQL statement, and arguments, corresponding to the expression.

    Type Parameters
    Name Description
    TDto1

    The type of the first DTO.

    TDto2

    The type of the second DTO.

    View Source

    VisitDto<TDto, TOut>(ISqlContext, Expression<Func<TDto, TOut>>, String)

    Visit an expression.

    Declaration
    public static (string Sql, object[] Args) VisitDto<TDto, TOut>(this ISqlContext sqlContext, Expression<Func<TDto, TOut>> expression, string alias = null)
    Parameters
    Type Name Description
    ISqlContext sqlContext

    An ISqlContext.

    System.Linq.Expressions.Expression<Func<TDto, TOut>> expression

    An expression to visit.

    System.String alias

    An optional table alias.

    Returns
    Type Description
    System.ValueTuple<System.String, System.Object[]>

    A SQL statement, and arguments, corresponding to the expression.

    Type Parameters
    Name Description
    TDto

    The type of the DTO.

    TOut

    The type returned by the expression.

    View Source

    VisitDto<TDto1, TDto2, TOut>(ISqlContext, Expression<Func<TDto1, TDto2, TOut>>, String, String)

    Visit an expression.

    Declaration
    public static (string Sql, object[] Args) VisitDto<TDto1, TDto2, TOut>(this ISqlContext sqlContext, Expression<Func<TDto1, TDto2, TOut>> expression, string alias1 = null, string alias2 = null)
    Parameters
    Type Name Description
    ISqlContext sqlContext

    An ISqlContext.

    System.Linq.Expressions.Expression<Func<TDto1, TDto2, TOut>> expression

    An expression to visit.

    System.String alias1

    An optional table alias for the first DTO.

    System.String alias2

    An optional table alias for the second DTO.

    Returns
    Type Description
    System.ValueTuple<System.String, System.Object[]>

    A SQL statement, and arguments, corresponding to the expression.

    Type Parameters
    Name Description
    TDto1

    The type of the first DTO.

    TDto2

    The type of the second DTO.

    TOut

    The type returned by the expression.

    View Source

    VisitModel<TModel>(ISqlContext, Expression<Func<TModel, Object>>)

    Visit a model expression.

    Declaration
    public static (string Sql, object[] Args) VisitModel<TModel>(this ISqlContext sqlContext, Expression<Func<TModel, object>> expression)
    Parameters
    Type Name Description
    ISqlContext sqlContext

    An ISqlContext.

    System.Linq.Expressions.Expression<Func<TModel, System.Object>> expression

    An expression to visit.

    Returns
    Type Description
    System.ValueTuple<System.String, System.Object[]>

    A SQL statement, and arguments, corresponding to the expression.

    Type Parameters
    Name Description
    TModel

    The type of the model.

    View Source

    VisitModelField<TModel>(ISqlContext, Expression<Func<TModel, Object>>)

    Visit a model expression representing a field.

    Declaration
    public static string VisitModelField<TModel>(this ISqlContext sqlContext, Expression<Func<TModel, object>> field)
    Parameters
    Type Name Description
    ISqlContext sqlContext

    An ISqlContext.

    System.Linq.Expressions.Expression<Func<TModel, System.Object>> field

    An expression to visit, representing a field.

    Returns
    Type Description
    System.String

    The name of the field.

    Type Parameters
    Name Description
    TModel

    The type of the model.

    • Improve this Doc
    • View Source
    In This Article
    • Methods
      • VisitDto<TDto>(ISqlContext, Expression<Func<TDto, Object>>, String)
      • VisitDto<TDto1, TDto2>(ISqlContext, Expression<Func<TDto1, TDto2, Object>>, String, String)
      • VisitDto<TDto, TOut>(ISqlContext, Expression<Func<TDto, TOut>>, String)
      • VisitDto<TDto1, TDto2, TOut>(ISqlContext, Expression<Func<TDto1, TDto2, TOut>>, String, String)
      • VisitModel<TModel>(ISqlContext, Expression<Func<TModel, Object>>)
      • VisitModelField<TModel>(ISqlContext, Expression<Func<TModel, Object>>)
    Back to top Copyright © 2016-present Umbraco
    Generated by DocFX