Struct AttachmentId
Represents a unique identifier for an attachment within the Collaboration SDK.
Implements
Inherited Members
Namespace: Unity.Cloud.Collaboration.Abstractions
Assembly: Unity.Cloud.Collaboration.dll
Syntax
public readonly struct AttachmentId : IEquatable<AttachmentId>
Remarks
The AttachmentId struct provides methods for creating, comparing, and manipulating attachment identifiers. It supports initialization using either a string or a Guid.
Constructors
AttachmentId(Guid)
Returns a AttachmentId using a Guid.
Declaration
public AttachmentId(Guid value)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | value | The guid representing the attachment identifier |
AttachmentId(string)
Returns a AttachmentId using a string.
Declaration
public AttachmentId(string value)
Parameters
| Type | Name | Description |
|---|---|---|
| string | value | The string representing the attachment identifier |
Methods
Equals(object)
Validate obj is a AttachmentId instance and have the same values as this instance.
Declaration
public override bool Equals(object obj)
Parameters
| Type | Name | Description |
|---|---|---|
| object | obj | Compare the values with this instance. |
Returns
| Type | Description |
|---|---|
| bool | true if both instance have the same values; false otherwise. |
Overrides
Equals(AttachmentId)
Returns whether two AttachmentId objects are equals.
Declaration
public bool Equals(AttachmentId other)
Parameters
| Type | Name | Description |
|---|---|---|
| AttachmentId | other | The other AttachmentId to compare with this instance. |
Returns
| Type | Description |
|---|---|
| bool | true if both instance have the same values; false otherwise. |
GetHashCode()
Compute a hash code for the object.
Declaration
public override int GetHashCode()
Returns
| Type | Description |
|---|---|
| int | A hash code for the current object. |
Overrides
Remarks
- You should not assume that equal hash codes imply object equality.
- You should never persist or use a hash code outside the application domain in which it was created, because the same object may hash differently across application domains, processes, and platforms.
ToString()
Get the string representation of this AttachmentId.
Declaration
public override string ToString()
Returns
| Type | Description |
|---|---|
| string | The string result. |
Overrides
Operators
operator ==(AttachmentId, AttachmentId)
Get if two AttachmentId represent the same.
Declaration
public static bool operator ==(AttachmentId left, AttachmentId right)
Parameters
| Type | Name | Description |
|---|---|---|
| AttachmentId | left | Compare with this first instance. |
| AttachmentId | right | Compare with this other instance. |
Returns
| Type | Description |
|---|---|
| bool |
explicit operator string(AttachmentId)
Explicitly cast a AttachmentId to a string
Declaration
public static explicit operator string(AttachmentId id)
Parameters
| Type | Name | Description |
|---|---|---|
| AttachmentId | id | Object to cast |
Returns
| Type | Description |
|---|---|
| string | The resulting string |
operator !=(AttachmentId, AttachmentId)
Get if two AttachmentId does not represent the same.
Declaration
public static bool operator !=(AttachmentId left, AttachmentId right)
Parameters
| Type | Name | Description |
|---|---|---|
| AttachmentId | left | Compare with this first instance. |
| AttachmentId | right | Compare with this other instance. |
Returns
| Type | Description |
|---|---|
| bool | true if both instances are not the same; false if both instances are the same. |