Class NPocoSqlExtensions.Statics
Provides a mean to express aliases in SELECT Sql statements.
Inheritance
System.Object
Namespace: Umbraco.Core.Persistence
Assembly: Umbraco.Core.dll
Syntax
public static class Statics
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. |
System.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. |
System.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. |
System.Func<System.String, System.String, System.String, System.String> | expr | A function producing Sql text. |
Returns
Type | Description |
---|---|
T |
Type Parameters
Name | Description |
---|---|
T |