Interface IFieldReader
Version: 21.x
Supports delayed reading of an IField.
Namespace: Sitecore.LayoutService.Client.Response.Model
Assembly: Sitecore.LayoutService.Client.Abstractions.dll
Syntax
Methods
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. |
If you have suggestions for improving this article, let us know!