Class SqlContextExtensions
Provides extension methods to ISqlContext.
Inheritance
Namespace: Umbraco.Extensions
Assembly: Umbraco.Infrastructure.dll
Syntax
public static class SqlContextExtensions
Methods
View SourceVisitDto<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. |
| Expression<Func<TDto, object>> | expression | An expression to visit. |
| string | alias | An optional table alias. |
Returns
| Type | Description |
|---|---|
| (string Sql, object[] Args) | A SQL statement, and arguments, corresponding to the expression. |
Type Parameters
| Name | Description |
|---|---|
| TDto | The type of the DTO. |
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. |
| Expression<Func<TDto1, TDto2, object>> | expression | An expression to visit. |
| string | alias1 | An optional table alias for the first DTO. |
| string | alias2 | An optional table alias for the second DTO. |
Returns
| Type | Description |
|---|---|
| (string Sql, object[] Args) | 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. |
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. |
| Expression<Func<TDto, TOut>> | expression | An expression to visit. |
| string | alias | An optional table alias. |
Returns
| Type | Description |
|---|---|
| (string Sql, object[] Args) | 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. |
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. |
| Expression<Func<TDto1, TDto2, TOut>> | expression | An expression to visit. |
| string | alias1 | An optional table alias for the first DTO. |
| string | alias2 | An optional table alias for the second DTO. |
Returns
| Type | Description |
|---|---|
| (string Sql, object[] Args) | 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. |
VisitDto<TDto1, TDto2, TDto3, TOut>(ISqlContext, Expression<Func<TDto1, TDto2, TDto3, TOut>>, string?, string?, string?)
Visit an expression.
Declaration
public static (string Sql, object[] Args) VisitDto<TDto1, TDto2, TDto3, TOut>(this ISqlContext sqlContext, Expression<Func<TDto1, TDto2, TDto3, TOut>> expression, string? alias1 = null, string? alias2 = null, string? alias3 = null)
Parameters
| Type | Name | Description |
|---|---|---|
| ISqlContext | sqlContext | An ISqlContext. |
| Expression<Func<TDto1, TDto2, TDto3, TOut>> | expression | An expression to visit. |
| string | alias1 | An optional table alias for the first DTO. |
| string | alias2 | An optional table alias for the second DTO. |
| string | alias3 | An optional table alias for the third DTO. |
Returns
| Type | Description |
|---|---|
| (string Sql, object[] Args) | 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. |
| TDto3 | The type of the third DTO. |
| TOut | The type returned by the expression. |
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. |
| Expression<Func<TModel, object>> | field | An expression to visit, representing a field. |
Returns
| Type | Description |
|---|---|
| string | The name of the field. |
Type Parameters
| Name | Description |
|---|---|
| TModel | The type of the model. |
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. |
| Expression<Func<TModel, object>> | expression | An expression to visit. |
Returns
| Type | Description |
|---|---|
| (string Sql, object[] Args) | A SQL statement, and arguments, corresponding to the expression. |
Type Parameters
| Name | Description |
|---|---|
| TModel | The type of the model. |