Class ContentListField
Version: 21.x
Allows list field types to be mapped to a specific model.
Inheritance
System.Object
ContentListField
Implements
Namespace: Sitecore.LayoutService.Client.Response.Model.Fields
Assembly: Sitecore.LayoutService.Client.Abstractions.dll
Syntax
Type Parameters
| Name | Description |
|---|---|
| TTargetModel | Strongly typed model to map the target of each list item to. |
Constructors
ContentListField()
Declaration
Methods
HandleRead(Type)
Returns an instance of the Field data as a specified type.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | The type to read the field as. |
Returns
| Type | Description |
|---|---|
| System.Object | A new instance of the specified type. |
Read(Type)
Reads the current Field as the specified type. The type must implement IField.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | The type of field to be read. |
Returns
| Type | Description |
|---|---|
| System.Object | A new instance if successful. |
Read()
Reads the current Field as the specified type.
Declaration
Returns
| Type | Description |
|---|---|
| TField | A new instance of TField. |
Type Parameters
| Name | Description |
|---|---|
| TField | The type of Field to be read. |
TryRead(Type, out IField)
Attempts to read the current Field as the specified type. The type must implement IField.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| System.Type | type | The type of field to be read. |
| IField | field | The resulting field. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the field could be read as the specified type, otherwise false. |
TryRead(out TField)
Attempts to read the current Field as the specified type.
Declaration
Parameters
| Type | Name | Description |
|---|---|---|
| TField | field | The resulting instance if successful. |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the field could be read as the specified type, otherwise false. |
Type Parameters
| Name | Description |
|---|---|
| TField | The type of Field to be read. |
Implements
If you have suggestions for improving this article, let us know!