Class SqlExtensionsStatics
Provides a mean to express aliases in SELECT Sql statements.
Inheritance
System.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 |
|---|---|---|
| System.Object | field | The field to alias. |
| System.String | alias | The alias. |
Returns
| Type | Description |
|---|---|
| System.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 |
|---|---|---|
| System.String | field | The name of the field. |
| Func<System.String, System.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 |
|---|---|---|
| System.String | field1 | The name of the first field. |
| System.String | field2 | The name of the second field. |
| Func<System.String, System.String, System.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 |
|---|---|---|
| System.String | field1 | The name of the first field. |
| System.String | field2 | The name of the second field. |
| System.String | field3 | The name of the third field. |
| Func<System.String, System.String, System.String, System.String> | expr | A function producing Sql text. |
Returns
| Type | Description |
|---|---|
| T |
Type Parameters
| Name | Description |
|---|---|
| T |