Class Reference
Represents a uniquely identifiable reference to an arbitrary entity in a third-party system.
Inherited Members
Namespace: EPiServer.Social.Common
Assembly: EPiServer.Social.Common.dll
Version: 1.5.4Syntax
public class Reference
Constructors
Reference()
Returns a newly created and initialized Reference instance.
Declaration
protected Reference()
Reference(String)
Returns a newly created and initialized Reference instance.
Declaration
protected Reference(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | id | String representing an identifier to be used as a reference. |
Properties
Empty
Gets an empty Reference value.
Declaration
public static Reference Empty { get; }
Property Value
| Type | Description |
|---|---|
| Reference |
Id
Returns the underlying reference identifier as string.
Declaration
public string Id { get; }
Property Value
| Type | Description |
|---|---|
| System.String |
Methods
Create(String)
Creates a Reference.
Declaration
public static Reference Create(string id)
Parameters
| Type | Name | Description |
|---|---|---|
| System.String | id | String representing an identifier to be used as a reference. |
Returns
| Type | Description |
|---|---|
| Reference | The created Reference object. |
Equals(Object)
Compares this instance with another object.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| System.Object | obj | the object to compare with this instance. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true if this instance and another specified object, of type Reference have the same value of the underlying reference identifier, else returns false. |
Overrides
GetHashCode()
Returns the hash code of the underlying reference identifier of this instance.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| System.Int32 | A 32-bit signed integer hash code. |
Overrides
IsEmpty()
Checks if the reference has not been assigned an Id, yet.
Declaration
public bool IsEmpty()
Returns
| Type | Description |
|---|---|
| System.Boolean |
IsNullOrEmpty(Reference)
Returns true if the specified reference is null or represents an empty Reference, false otherwise.
Declaration
public static bool IsNullOrEmpty(Reference reference)
Parameters
| Type | Name | Description |
|---|---|---|
| Reference | reference | Reference instance to verify |
Returns
| Type | Description |
|---|---|
| System.Boolean | True if the reference is null or empty, false otherwise |
ToString()
Returns a string representation of this instance.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| System.String | Returns the underlying reference identifier of this instance as a string. |
Overrides
Operators
Equality(Reference, Reference)
Overloads the equality operator on the Reference class.
Declaration
public static bool operator ==(Reference a, Reference b)
Parameters
| Type | Name | Description |
|---|---|---|
| Reference | a | The operand on the left side of the equality operator. |
| Reference | b | The operand on the right side of the equality operator. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true if the both objects are null or the same instance or have the same value of the underlying reference identifier. Returns false if either object is null or both objects have different values of the underlying reference identifier. |
Inequality(Reference, Reference)
Overloads the inequality operator on the Reference class.
Declaration
public static bool operator !=(Reference a, Reference b)
Parameters
| Type | Name | Description |
|---|---|---|
| Reference | a | The operand on the left side of the inequality operator. |
| Reference | b | The operand on the right side of the inequality operator. |
Returns
| Type | Description |
|---|---|
| System.Boolean | Returns true if either object is null or both objects have different values of the underlying reference identifier. Returns false if the both objects are null or the same instance or have the same value of the underlying reference identifier. |