Class SqlContextExtensions
Provides extension methods to ISqlContext.
Inheritance
Namespace: Umbraco.Core.Persistence
Assembly: Umbraco.Core.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. |
System.Linq.Expressions.Expression<System.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. |
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<System.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. |
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<System.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. |
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<System.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. |
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<System.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. |
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<System.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. |