Table of Contents

Struct CountryId

Namespace
Core.Data.Ids
Assembly
Core.dll

Type-safe country identifier Prevents mixing up country IDs with other entity IDs at compile time Following data-linking-architecture.md specifications

[Serializable]
public readonly struct CountryId

Constructors

CountryId(ushort)

public CountryId(ushort value)

Parameters

value ushort

Fields

None

Special constant for no country/unowned

public static readonly CountryId None

Field Value

CountryId

Value

public readonly ushort Value

Field Value

ushort

Properties

IsValid

Check if this is a valid country ID (not none/zero)

public bool IsValid { get; }

Property Value

bool

Methods

Equals(CountryId)

public bool Equals(CountryId other)

Parameters

other CountryId

Returns

bool

Equals(object)

public override bool Equals(object obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int

ToString()

public override string ToString()

Returns

string

Operators

operator ==(CountryId, CountryId)

public static bool operator ==(CountryId left, CountryId right)

Parameters

left CountryId
right CountryId

Returns

bool

implicit operator ushort(CountryId)

public static implicit operator ushort(CountryId id)

Parameters

id CountryId

Returns

ushort

implicit operator CountryId(ushort)

public static implicit operator CountryId(ushort value)

Parameters

value ushort

Returns

CountryId

operator !=(CountryId, CountryId)

public static bool operator !=(CountryId left, CountryId right)

Parameters

left CountryId
right CountryId

Returns

bool