Table of Contents

Class ItemLinkField

Namespace
Sitecore.AspNetCore.SDK.LayoutService.Client.Response.Model.Fields
Assembly
Sitecore.AspNetCore.SDK.LayoutService.Client.dll

Represents an item link field.

public class ItemLinkField : FieldsReader, IFieldsReader, IField, IFieldReader
Inheritance
ItemLinkField
Implements
Derived
Inherited Members

Properties

Id

Gets or sets the ID for this IField.

public Guid Id { get; set; }

Property Value

Guid

Url

Gets or sets the URL for this IField.

public string? Url { get; set; }

Property Value

string

Methods

HandleRead(Type)

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

protected virtual object HandleRead(Type type)

Parameters

type Type

The type to read the field as.

Returns

object

A new instance of the specified type.

Read(Type)

Reads the current Field as the specified type. The type must implement IField.

public virtual object Read(Type type)

Parameters

type Type

The type of field to be read.

Returns

object

A new instance if successful.

Read<TField>()

Reads the current Field as the specified type.

public virtual 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.

public virtual bool TryRead(Type type, out IField? field)

Parameters

type Type

The type of field to be read.

field IField

The resulting field.

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.

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

Parameters

field TField

The 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.