Class Address
Represents the textual parts of a geographic address.
public sealed class Address : IEquatable<Address>
- Inheritance
-
Address
- Implements
- Inherited Members
Constructors
Address(string, string, string, string)
Represents the textual parts of a geographic address.
public Address(string _country = "", string _province = "", string _city = "", string _street = "")
Parameters
_countrystringThe country name.
_provincestringThe province or state name.
_citystringThe city name.
_streetstringThe street address.
Properties
City
Gets the city name.
public string City { get; }
Property Value
Country
Gets the country name.
public string Country { get; }
Property Value
FormattedAddress
Gets the non-empty address parts joined from street to country.
public string FormattedAddress { get; }
Property Value
IsAllSet
Gets whether every address part is set.
public bool IsAllSet { get; }
Property Value
IsSet
Gets whether at least one address part is set.
public bool IsSet { get; }
Property Value
NotFound
Gets the sentinel address used when an address lookup found no result.
public static Address NotFound { get; }
Property Value
Province
Gets the province or state name.
public string Province { get; }
Property Value
Street
Gets the street address.
public string Street { get; }
Property Value
Undefined
Gets an address with no defined parts.
public static Address Undefined { get; }
Property Value
Methods
Equals(object)
Determines whether the specified object is equal to the current object.
public override bool Equals(object obj)
Parameters
objobjectThe object to compare with the current object.
Returns
Equals(Address)
Indicates whether the current object is equal to another object of the same type.
public bool Equals(Address other)
Parameters
otherAddressAn object to compare with this object.
Returns
FromJsonString(string)
Deserializes an address from JSON.
public static Address FromJsonString(string jsonString)
Parameters
jsonStringstringThe JSON to deserialize.
Returns
GetHashCode()
Serves as the default hash function.
public override int GetHashCode()
Returns
- int
A hash code for the current object.
ToJsonString()
Serializes the address to compact JSON.
public string ToJsonString()
Returns
- string
The serialized address.
ToString()
Serializes the address to indented JSON.
public override string ToString()
Returns
- string
The formatted address JSON.