Struct UmbracoEntityReference
Used to track a reference to another entity in a property value.
Namespace: Umbraco.Cms.Core.Models.Editors
Assembly: Umbraco.Core.dll
Syntax
public struct UmbracoEntityReference
Constructors
View SourceUmbracoEntityReference(Udi)
Initializes a new instance of the UmbracoEntityReference struct for a document or media item.
Declaration
public UmbracoEntityReference(Udi udi)
Parameters
| Type | Name | Description |
|---|---|---|
| Udi | udi | The UDI. |
UmbracoEntityReference(Udi, string)
Initializes a new instance of the UmbracoEntityReference struct.
Declaration
public UmbracoEntityReference(Udi udi, string relationTypeAlias)
Parameters
| Type | Name | Description |
|---|---|---|
| Udi | udi | The UDI. |
| string | relationTypeAlias | The relation type alias. |
Properties
View SourceRelationTypeAlias
Gets the relation type alias.
Declaration
public readonly string RelationTypeAlias { get; }
Property Value
| Type | Description |
|---|---|
| string | The relation type alias. |
Udi
Gets the UDI.
Declaration
public readonly Udi Udi { get; }
Property Value
| Type | Description |
|---|---|
| Udi | The UDI. |
Methods
View SourceEmpty()
Gets an empty reference.
Declaration
public static UmbracoEntityReference Empty()
Returns
| Type | Description |
|---|---|
| UmbracoEntityReference | An empty reference. |
Equals(object?)
Indicates whether this instance and a specified object are equal.
Declaration
public override bool Equals(object? obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | The object to compare with the current instance. |
Returns
| Type | Description |
|---|---|
| bool | true if |
Equals(UmbracoEntityReference)
Indicates whether the current object is equal to another object of the same type.
Declaration
public bool Equals(UmbracoEntityReference other)
Parameters
| Type | Name | Description |
|---|---|---|
| UmbracoEntityReference | other | An object to compare with this object. |
Returns
| Type | Description |
|---|---|
| bool | true if the current object is equal to the |
GetHashCode()
Returns the hash code for this instance.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A 32-bit signed integer that is the hash code for this instance. |
IsEmpty(UmbracoEntityReference)
Determines whether the specified reference is empty.
Declaration
public static bool IsEmpty(UmbracoEntityReference reference)
Parameters
| Type | Name | Description |
|---|---|---|
| UmbracoEntityReference | reference | The reference. |
Returns
| Type | Description |
|---|---|
| bool |
|
Operators
View Sourceoperator ==(UmbracoEntityReference, UmbracoEntityReference)
Declaration
public static bool operator ==(UmbracoEntityReference left, UmbracoEntityReference right)
Parameters
| Type | Name | Description |
|---|---|---|
| UmbracoEntityReference | left | |
| UmbracoEntityReference | right |
Returns
| Type | Description |
|---|---|
| bool |
operator !=(UmbracoEntityReference, UmbracoEntityReference)
Declaration
public static bool operator !=(UmbracoEntityReference left, UmbracoEntityReference right)
Parameters
| Type | Name | Description |
|---|---|---|
| UmbracoEntityReference | left | |
| UmbracoEntityReference | right |
Returns
| Type | Description |
|---|---|
| bool |