Class SqlExtensionsStatics
Provides a mean to express aliases in SELECT Sql statements.
Inheritance
object
Namespace: Umbraco.Cms.Core.Persistence
Assembly: Umbraco.Core.dll
Syntax
public static class SqlExtensionsStatics
Remarks
First register with using static Umbraco.Core.Persistence.NPocoSqlExtensions.Aliaser,
then use eg Sql{Foo}(x => Alias(x.Id, "id")).
Methods
View SourceAlias(object?, string)
Aliases a field.
Declaration
public static object? Alias(object? field, string alias)
Parameters
| Type | Name | Description |
|---|---|---|
| object | field | The field to alias. |
| string | alias | The alias. |
Returns
| Type | Description |
|---|---|
| object |
SqlText<T>(string, Func<string, string>)
Produces Sql text.
Declaration
public static T? SqlText<T>(string field, Func<string, string> expr)
Parameters
| Type | Name | Description |
|---|---|---|
| string | field | The name of the field. |
| Func<string, string> | expr | A function producing Sql text. |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
SqlText<T>(string, string, Func<string, string, string>)
Produces Sql text.
Declaration
public static T? SqlText<T>(string field1, string field2, Func<string, string, string> expr)
Parameters
| Type | Name | Description |
|---|---|---|
| string | field1 | The name of the first field. |
| string | field2 | The name of the second field. |
| Func<string, string, string> | expr | A function producing Sql text. |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |
SqlText<T>(string, string, string, Func<string, string, string, string>)
Produces Sql text.
Declaration
public static T? SqlText<T>(string field1, string field2, string field3, Func<string, string, string, string> expr)
Parameters
| Type | Name | Description |
|---|---|---|
| string | field1 | The name of the first field. |
| string | field2 | The name of the second field. |
| string | field3 | The name of the third field. |
| Func<string, string, string, string> | expr | A function producing Sql text. |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |