Class ItemLinkField

Version: 21.x

Represents an item link field.

Inheritance

System.Object

FieldsReader

ItemLinkField

ItemLinkField

Implements

IFieldsReader

IField

IFieldReader

Inherited Members

FieldsReader.ReadField(String)

FieldsReader.TryReadField(String, TField)

FieldsReader.ReadFields()

FieldsReader.TryReadFields(T)

FieldsReader.ReadField(Type, String)

FieldsReader.TryReadField(Type, String, Object)

FieldsReader.TryReadFields(Type, Object)

FieldsReader.ReadFields(Type)

FieldsReader.HandleReadFields(Type)

FieldsReader.Fields

Namespace: Sitecore.LayoutService.Client.Response.Model.Fields
Assembly: Sitecore.LayoutService.Client.Abstractions.dll
Syntax
public class ItemLinkField : FieldsReader, IFieldsReader, IField, IFieldReader

Constructors

ItemLinkField()

Declaration
public ItemLinkField()

Properties

Id

Gets or sets the ID for this IField.

Declaration
public Guid Id { get; set; }
Property Value
TypeDescription
System.Guid

Url

Gets or sets the URL for this IField.

Declaration
public string Url { get; set; }
Property Value
TypeDescription
System.String

Methods

HandleRead(Type)

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

Declaration
protected virtual object HandleRead(Type type)
Parameters
TypeNameDescription
System.TypetypeThe type to read the field as.
Returns
TypeDescription
System.ObjectA 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
TypeNameDescription
System.TypetypeThe type of field to be read.
Returns
TypeDescription
System.ObjectA new instance if successful.

Read()

Reads the current Field as the specified type.

Declaration

public virtual TField Read<TField>()
    where TField : IField

Returns
TypeDescription
TFieldA new instance of TField.
Type Parameters
NameDescription
TFieldThe 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
TypeNameDescription
System.TypetypeThe type of field to be read.
IFieldfieldThe resulting field.
Returns
TypeDescription
System.BooleanTrue 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

public virtual bool TryRead<TField>(out TField field)
    where TField : IField

Parameters
TypeNameDescription
TFieldfieldThe resulting instance if successful.
Returns
TypeDescription
System.BooleanTrue if the field could be read as the specified type, otherwise false.
Type Parameters
NameDescription
TFieldThe type of Field to be read.

Implements

IFieldsReader

IField

IFieldReader

If you have suggestions for improving this article, let us know!