Class NPocoSqlExtensions.SqlRef<TDto>
Represents a Dto reference expression.
Inheritance
Namespace: Umbraco.Extensions
Assembly: Umbraco.Infrastructure.dll
Syntax
public class NPocoSqlExtensions.SqlRef<TDto>
Type Parameters
| Name | Description |
|---|---|
| TDto | The type of the referencing Dto. |
Constructors
View SourceSqlRef(Sql<ISqlContext>, string?)
Initializes a new Dto reference expression.
Declaration
public SqlRef(Sql<ISqlContext> sql, string? prefix)
Parameters
| Type | Name | Description |
|---|---|---|
| Sql<ISqlContext> | sql | The original Sql expression. |
| string | prefix | The current Dtos prefix. |
Properties
View SourcePrefix
Gets the current Dtos prefix.
Declaration
public string? Prefix { get; }
Property Value
| Type | Description |
|---|---|
| string |
Sql
Gets the original Sql expression.
Declaration
public Sql<ISqlContext> Sql { get; }
Property Value
| Type | Description |
|---|---|
| Sql<ISqlContext> |
Methods
View SourceSelect<TRefDto>(Expression<Func<TDto, List<TRefDto>>>, Func<SqlRef<TRefDto>, SqlRef<TRefDto>>?)
Selects referenced DTOs.
Declaration
public NPocoSqlExtensions.SqlRef<TDto> Select<TRefDto>(Expression<Func<TDto, List<TRefDto>>> field, Func<NPocoSqlExtensions.SqlRef<TRefDto>, NPocoSqlExtensions.SqlRef<TRefDto>>? reference = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Expression<Func<TDto, List<TRefDto>>> | field | An expression specifying the referencing field. |
| Func<NPocoSqlExtensions.SqlRef<TRefDto>, NPocoSqlExtensions.SqlRef<TRefDto>> | reference | An optional expression representing a nested reference selection. |
Returns
| Type | Description |
|---|---|
| NPocoSqlExtensions.SqlRef<TDto> | A referenced DTO expression. |
Type Parameters
| Name | Description |
|---|---|
| TRefDto | The type of the referenced DTOs. |
Remarks
The referencing property has to be a List{.TRefDto}
Select<TRefDto>(Expression<Func<TDto, List<TRefDto>>>, string?, Func<SqlRef<TRefDto>, SqlRef<TRefDto>>?)
Selects referenced DTOs.
Declaration
public NPocoSqlExtensions.SqlRef<TDto> Select<TRefDto>(Expression<Func<TDto, List<TRefDto>>> field, string? tableAlias, Func<NPocoSqlExtensions.SqlRef<TRefDto>, NPocoSqlExtensions.SqlRef<TRefDto>>? reference = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Expression<Func<TDto, List<TRefDto>>> | field | An expression specifying the referencing field. |
| string | tableAlias | The DTO table alias. |
| Func<NPocoSqlExtensions.SqlRef<TRefDto>, NPocoSqlExtensions.SqlRef<TRefDto>> | reference | An optional expression representing a nested reference selection. |
Returns
| Type | Description |
|---|---|
| NPocoSqlExtensions.SqlRef<TDto> | A referenced DTO expression. |
Type Parameters
| Name | Description |
|---|---|
| TRefDto | The type of the referenced DTOs. |
Remarks
The referencing property has to be a List{.TRefDto}
Select<TRefDto>(Expression<Func<TDto, TRefDto>>, Func<SqlRef<TRefDto>, SqlRef<TRefDto>>?)
Appends fields for a referenced Dto.
Declaration
public NPocoSqlExtensions.SqlRef<TDto> Select<TRefDto>(Expression<Func<TDto, TRefDto>> field, Func<NPocoSqlExtensions.SqlRef<TRefDto>, NPocoSqlExtensions.SqlRef<TRefDto>>? reference = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Expression<Func<TDto, TRefDto>> | field | An expression specifying the referencing field. |
| Func<NPocoSqlExtensions.SqlRef<TRefDto>, NPocoSqlExtensions.SqlRef<TRefDto>> | reference | An optional expression representing a nested reference selection. |
Returns
| Type | Description |
|---|---|
| NPocoSqlExtensions.SqlRef<TDto> | A SqlRef statement. |
Type Parameters
| Name | Description |
|---|---|
| TRefDto | The type of the referenced Dto. |
Select<TRefDto>(Expression<Func<TDto, TRefDto>>, string?, Func<SqlRef<TRefDto>, SqlRef<TRefDto>>?)
Appends fields for a referenced Dto.
Declaration
public NPocoSqlExtensions.SqlRef<TDto> Select<TRefDto>(Expression<Func<TDto, TRefDto>> field, string? tableAlias, Func<NPocoSqlExtensions.SqlRef<TRefDto>, NPocoSqlExtensions.SqlRef<TRefDto>>? reference = null)
Parameters
| Type | Name | Description |
|---|---|---|
| Expression<Func<TDto, TRefDto>> | field | An expression specifying the referencing field. |
| string | tableAlias | The referenced Dto table alias. |
| Func<NPocoSqlExtensions.SqlRef<TRefDto>, NPocoSqlExtensions.SqlRef<TRefDto>> | reference | An optional expression representing a nested reference selection. |
Returns
| Type | Description |
|---|---|
| NPocoSqlExtensions.SqlRef<TDto> | A SqlRef statement. |
Type Parameters
| Name | Description |
|---|---|
| TRefDto | The type of the referenced Dto. |