Interface IFieldReader
- Namespace
- Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model
- Assembly
- Sitecore.AspNetCore.SDK.LayoutService.Client.dll
Supports delayed reading of an IField.
public interface IFieldReader
Methods
Read(Type)
Reads the current Field as the specified type. The type must implement IField.
object? Read(Type type)
Parameters
type
TypeThe type of field to be read.
Returns
- object
A new instance if successful.
Read<TField>()
Reads the current Field as the specified type.
TField? Read<TField>() where TField : IField
Returns
- TField
A new instance of
TField
.
Type Parameters
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.
bool TryRead(Type type, out IField? field)
Parameters
Returns
- bool
True if the field could be read as the specified type, otherwise false.
TryRead<TField>(out TField?)
Attempts to read the current Field as the specified type.
bool TryRead<TField>(out TField? field) where TField : IField
Parameters
field
TFieldThe resulting instance if successful.
Returns
- bool
True if the field could be read as the specified type, otherwise false.
Type Parameters
TField
The type of Field to be read.