Show / Hide Table of Contents

Class ContentListField<TTargetModel>

Allows list field types to be mapped to a specific model.

Inheritance
System.Object
ContentListField<TTargetModel>
Implements
IField
IFieldReader
Namespace: Sitecore.LayoutService.Client.Response.Model.Fields
Assembly: Sitecore.LayoutService.Client.Abstractions.dll
Syntax
public class ContentListField<TTargetModel> : List<ItemLinkField<TTargetModel>>, IField, IFieldReader where TTargetModel : class
Type Parameters
Name Description
TTargetModel

Strongly typed model to map the target of each list item to.

Constructors

ContentListField()

Declaration
public ContentListField()

Methods

HandleRead(Type)

Returns an instance of the Field data as a specified type.

Declaration
protected virtual object HandleRead(Type type)
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
public virtual object Read(Type type)
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<TField>()

Reads the current Field as the specified type.

Declaration
public virtual TField Read<TField>()
    where TField : IField
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
public virtual bool TryRead(Type type, out IField field)
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<TField>(out TField)

Declaration
public virtual bool TryRead<TField>(out TField field)
    where TField : IField
Parameters
Type Name Description
TField field
Returns
Type Description
System.Boolean
Type Parameters
Name Description
TField

Implements

IField
IFieldReader
Back to top Generated by DocFX