Interface IFieldsReader
- Namespace
- Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model
- Assembly
- Sitecore.AspNetCore.SDK.LayoutService.Client.dll
Exposes a collection of IFieldReader.
public interface IFieldsReaderProperties
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 : IFieldParameters
- namestring
- The 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
- typeType
- The 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
- typeType
- The type of object to return. 
- namestring
- The name of the field to be read. 
- instanceobject
- A new instance of - typeif 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 : IFieldParameters
- namestring
- The name of the field to be read. 
- instanceTField
- The 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
- instanceT
- The resulting instance if successful. 
Returns
- bool
- True if successful, otherwise false. 
Type Parameters
- T
- The type of object to return.