Skip to content

GrainReference Methods

This is the base class for all grain references.

Cast

virtual
View source
public virtual TGrainInterface Cast<TGrainInterface>()
Creates a new grain reference which implements the specified grain interface.

Returns

A new grain reference which implements the specified interface type.

Equals(GrainReference?)

View source
public bool Equals(GrainReference? other)
Indicates whether the current object is equal to another object of the same type.

Parameters

otherGrainReference?
An object to compare with this object.

Returns

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

Equals(object?)

override
View source
public override bool Equals(object? obj)
Tests this reference for equality to another object. Two grain references are equal if they both refer to the same grain.

Parameters

objobject?
The object to test for equality against this reference.

Returns

true if the object is equal to this reference.

GetHashCode

override
View source
public override int GetHashCode()
Serves as the default hash function.

Returns

A hash code for the current object.

ToString

override
View source
public sealed override string ToString()
Returns a string that represents the current object.

Returns

A string that represents the current object.

operator ==(GrainReference?, GrainReference?)

static
View source
public static bool operator ==(GrainReference? reference1, GrainReference? reference2)
Compares two references for equality. Two grain references are equal if they both refer to the same grain.

Parameters

reference1GrainReference?
First grain reference to compare.
reference2GrainReference?
Second grain reference to compare.

Returns

true if both grain references refer to the same grain (by grain identifier).

operator !=(GrainReference?, GrainReference?)

static
View source
public static bool operator !=(GrainReference? reference1, GrainReference? reference2)
Compares two references for inequality. Two grain references are equal if they both refer to the same grain.

Parameters

reference1GrainReference?
First grain reference to compare.
reference2GrainReference?
Second grain reference to compare.

Returns

false if both grain references are resolved to the same grain (by grain identifier).