Interface IFieldsReader
- Namespace
- Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model
- Assembly
- Sitecore.AspNetCore.SDK.LayoutService.Client.dll
Exposes a collection of IFieldReader.
public interface IFieldsReader
Properties
Fields
Gets or sets the Fields associated with this instance.
Dictionary<string, IFieldReader> Fields { get; set; }
Property Value
Methods
ReadField(Type, string)
Reads a field from the collection as the specified type.
object? ReadField(Type type, string name)
Parameters
Returns
- object
A new instance of the specified type.
ReadField<TField>(string)
Reads a field from the collection as the specified type.
TField? ReadField<TField>(string name) where TField : IField
Parameters
name
stringThe name of the field to be read.
Returns
- TField
A new instance of
TField
.
Type Parameters
TField
The type of object to return.
ReadFields(Type)
Reads the collection of fields as the specified type.
object? ReadFields(Type type)
Parameters
type
TypeThe type of object to return.
Returns
- object
A new instance of the specified type.
ReadFields<T>()
Reads the collection of fields as the specified type.
T? ReadFields<T>() where T : new()
Returns
- T
A new instance of
T
.
Type Parameters
T
The type of object to return.
TryReadField(Type, string, out object?)
Attempts to read a field from the collection as the specified type.
bool TryReadField(Type type, string name, out object? instance)
Parameters
type
TypeThe type of object to return.
name
stringThe name of the field to be read.
instance
objectA new instance of
type
if successful.
Returns
- bool
True if successful, otherwise false.
TryReadField<TField>(string, out TField?)
Attempts to read a field from the collection as the specified type.
bool TryReadField<TField>(string name, out TField? instance) where TField : IField
Parameters
name
stringThe name of the field to be read.
instance
TFieldThe resulting instance if successful.
Returns
- bool
True if successful, otherwise false.
Type Parameters
TField
The type of object to return.
TryReadFields(Type, out object?)
Attempts to read the collection of fields as the specified type.
bool TryReadFields(Type type, out object? instance)
Parameters
Returns
- bool
True if successful, otherwise false.
TryReadFields<T>(out T?)
Attempts to read the collection of fields as the specified type.
bool TryReadFields<T>(out T? instance) where T : new()
Parameters
instance
TThe resulting instance if successful.
Returns
- bool
True if successful, otherwise false.
Type Parameters
T
The type of object to return.