Don't miss out Virtual Happy Hour today (April 26).

Try our conversational search powered by Generative AI!

Class SoftLink

Reads and edits links defined in HTML.

Inheritance
System.Object
SoftLink
Implements
System.IEquatable<SoftLink>
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: EPiServer.DataAbstraction
Assembly: EPiServer.dll
Version: 8.11.0
public class SoftLink : IEquatable<SoftLink>

Constructors

Initializes a new instance of the SoftLink class with default values.

Declaration
public SoftLink()

Properties

Date when the link was first found broken

Declaration
public DateTime? FirstDateBroken { get; set; }
Property Value
Type Description
System.Nullable<System.DateTime>

HttpStatus code if broken

Declaration
public HttpStatusCode? HttpStatusCode { get; set; }
Property Value
Type Description
System.Nullable<System.Net.HttpStatusCode>

Id of the soft link

Declaration
public int Id { get; set; }
Property Value
Type Description
System.Int32

Date when the link was last checked

Declaration
public DateTime? LastCheckedDate { get; set; }
Property Value
Type Description
System.Nullable<System.DateTime>

Gets or sets the service used to resolve links.

Declaration
public Injected<IPermanentLinkMapper> LinkMapper { get; set; }
Property Value
Type Description
Injected<IPermanentLinkMapper>

Current System.Net.WebExceptionStatus

Declaration
public WebExceptionStatus? LinkStatus { get; set; }
Property Value
Type Description
System.Nullable<System.Net.WebExceptionStatus>

Gets or sets the owner content link.

Declaration
public ContentReference OwnerContentLink { get; set; }
Property Value
Type Description
ContentReference

The owner content link.

Gets or sets the owner language branch.

Declaration
public CultureInfo OwnerLanguage { get; set; }
Property Value
Type Description
System.Globalization.CultureInfo

The owner language branch.

Gets or sets the page link for the referencing page.

Declaration
[Obsolete("Use OwnerContentLink instead", true)]
public PageReference OwnerPageLink { get; set; }
Property Value
Type Description
PageReference

Gets the page link for the referenced page.

Declaration
[Obsolete("Use ReferencedContentLink instead", true)]
public PageReference PageLink { get; }
Property Value
Type Description
PageReference

The page link.

Gets the protocol part of the link.

Declaration
public string Protocol { get; }
Property Value
Type Description
System.String

Gets or sets the referenced content link.

Declaration
public ContentReference ReferencedContentLink { get; set; }
Property Value
Type Description
ContentReference

The referenced content link.

Gets or sets the referencedlanguage branch.

Declaration
public CultureInfo ReferencedLanguage { get; set; }
Property Value
Type Description
System.Globalization.CultureInfo

The referencedlanguage branch.

Gets or sets the type of the referenced object.

Declaration
public ReferenceType SoftLinkType { get; set; }
Property Value
Type Description
ReferenceType

The type of the soft link.

Get or set the Url of the link The set will also affect the Protocol and PageLink properties

Declaration
public string UnresolvedUrl { get; protected set; }
Property Value
Type Description
System.String

Get or set the Url of the link The set will also affect the Protocol and PageLink properties

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

Methods

Clears the checked state of the current SoftLink instance.

Declaration
public virtual void ClearState()

Indicates whether the current object is equal to another object of the same type.

Declaration
public bool Equals(SoftLink other)
Parameters
Type Name Description
SoftLink other

An object to compare with this object.

Returns
Type Description
System.Boolean

true if the current object is equal to the other parameter; otherwise, false.

Determines whether the specified System.Object is equal to this instance.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
System.Object obj

The System.Object to compare with this instance.

Returns
Type Description
System.Boolean

true if the specified System.Object is equal to this instance; otherwise, false.

Overrides
System.Object.Equals(System.Object)
Exceptions
Type Condition
System.NullReferenceException

The obj parameter is null.

Returns a hash code for this instance.

Declaration
public override int GetHashCode()
Returns
Type Description
System.Int32

A hash code for this instance, suitable for use in hashing algorithms and data structures like a hash table.

Overrides
System.Object.GetHashCode()

Loads a collection of SoftLink objects for where the specified content link is the owner (OwnerPageLink).

Declaration
[Obsolete("Use repository class instead: ServiceLocator.Current.GetInstance<ContentSoftLinkRepository>()")]
public static SoftLinkCollection Load(ContentReference contentLink)
Parameters
Type Name Description
ContentReference contentLink

The content link to retrieve SoftLink objects for.

Returns
Type Description
SoftLinkCollection

A collection of SoftLink instances that will contain information about all links from the page specified by contentLink.

Loads the links that reference a specified file.

Declaration
[Obsolete("Use repository class instead: ServiceLocator.Current.GetInstance<ContentSoftLinkRepository>()")]
public static SoftLinkCollection Load(UnifiedFile file)
Parameters
Type Name Description
UnifiedFile file

The file.

Returns
Type Description
SoftLinkCollection

A collection of SoftLink instances that will contain information about all links that point to the file specified in file.

Loads the links that reference the file specified with a path.

Declaration
[Obsolete("Use repository class instead: ServiceLocator.Current.GetInstance<ContentSoftLinkRepository>()")]
public static SoftLinkCollection Load(string path)
Parameters
Type Name Description
System.String path

The path.

Returns
Type Description
SoftLinkCollection

A collection of SoftLink instances that will contain information about all links that point to the file specified in path.

Loads the links that reference the file specified with a path.

Declaration
[Obsolete("Use repository class instead: ServiceLocator.Current.GetInstance<ContentSoftLinkRepository>()")]
public static SoftLinkCollection Load(string path, bool exactMatch)
Parameters
Type Name Description
System.String path

The path.

System.Boolean exactMatch

if set to true an exact match is required. If set to false only the beginning of the path needs to match.

Returns
Type Description
SoftLinkCollection

A collection of SoftLink instances that will contain information about all links that point to the file specified in path.

Loads a collection of SoftLink objects for where the specified page link is the target (PageLink). The result will contain information about all pages pointing to the page specified by contentLink.

Declaration
[Obsolete("Use repository class instead: ServiceLocator.Current.GetInstance<ContentSoftLinkRepository>()")]
public static SoftLinkCollection LoadReferencing(ContentReference contentLink)
Parameters
Type Name Description
ContentReference contentLink

The content link to retrieve SoftLink objects for.

Returns
Type Description
SoftLinkCollection

A collection of SoftLink instances that will contain information about all links that point to the page specified by contentLink.

Saves all the specified SoftLink instances with the same owner page link.

Declaration
[Obsolete("Use repository class instead: ServiceLocator.Current.GetInstance<ContentSoftLinkRepository>()")]
public static void Save(ContentReference ownerContent, CultureInfo languageID, SoftLinkCollection coll)
Parameters
Type Name Description
ContentReference ownerContent

The owner content link.

System.Globalization.CultureInfo languageID

The language, specify null to re-save links for all languages

SoftLinkCollection coll

The collection of SoftLink instances.

Saves the specified collection of SoftLink instances.

Declaration
[Obsolete("Use repository class instead: ServiceLocator.Current.GetInstance<ContentSoftLinkRepository>()")]
public static void Save(SoftLinkCollection coll)
Parameters
Type Name Description
SoftLinkCollection coll

A collection of SoftLink to save.

Implements

System.IEquatable<T>

Extension Methods