Table of Contents

Class Address

Namespace
XENBIT.ResQueServe.Core.Models
Assembly
RQS.Core.dll
public record Address : IAddress, IAddressDistrict, IAddressCity, IAddressCommune, IAddressState, IEquatable<Address>
Inheritance
Address
Implements
Inherited Members
Extension Methods

Constructors

Address()

[JsonConstructor]
public Address()

Address(Address)

protected Address(Address original)

Parameters

original Address

Properties

AddressPackageId

public int AddressPackageId { get; set; }

Property Value

int

CityId

public long CityId { get; set; }

Property Value

long

CityName

The name of the city. This property is crucial for identifying the city within its broader regional context (e.g., state, commune).

public string CityName { get; set; }

Property Value

string

CommuneId

public long CommuneId { get; set; }

Property Value

long

CommuneName

The name of the commune.

public string CommuneName { get; set; }

Property Value

string

Country

The country to which this state belongs. The Country class encapsulates details like the country's name, its ISO codes, and other pertinent information.

public Country Country { get; set; }

Property Value

Country

DistrictCoordinates

public Coordinates DistrictCoordinates { get; }

Property Value

Coordinates

DistrictId

public int DistrictId { get; set; }

Property Value

int

DistrictLat

The latitude coordinate of the district. This geographic detail supports mapping and location-based services. If the specific street coordinates are not available, these coordinates serve as a fallback location.

public double DistrictLat { get; set; }

Property Value

double

DistrictLng

The longitude coordinate of the district. Alongside latitude, this provides a precise location for the district on global mapping services. Like latitude, longitude will also be used as a fallback if specific street coordinates cannot be found.

public double DistrictLng { get; set; }

Property Value

double

DistrictName

The name of the district.

public string DistrictName { get; set; }

Property Value

string

DistrictPhonePrefix

The phone prefix used within the district. This property can be null if the phone prefix is not applicable or not defined.

public string? DistrictPhonePrefix { get; set; }

Property Value

string

DistrictZip

The postal code for the district.

public string DistrictZip { get; set; }

Property Value

string

EqualityContract

protected virtual Type EqualityContract { get; }

Property Value

Type

Id

public long Id { get; set; }

Property Value

long

StateId

public int StateId { get; set; }

Property Value

int

StateName

The name of the state.

public string StateName { get; set; }

Property Value

string

Street

The name of the street for this address. This property is essential for locating the address within its district and city context. Is unique inside a district.

public string Street { get; set; }

Property Value

string

StreetNumberMax

The maximum street number available for this address. Similar to the minimum street number, this optional field defines the upper limit for randomly generating house numbers within the simulation, providing flexibility in address allocation.

public int? StreetNumberMax { get; set; }

Property Value

int?

StreetNumberMin

The minimum street number available for this address. This optional field can be used in the simulation to randomly generate a house number within a defined range, starting from this minimum value.

public int? StreetNumberMin { get; set; }

Property Value

int?

Methods

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

Equals(Address?)

public virtual bool Equals(Address? other)

Parameters

other Address

Returns

bool

GetCoordinatesAsync(string?, params ICoordinatesResolver[]?)

Asynchronously retrieves the geocoding result for this address using multiple resolvers, with the option to specify a house number.

public virtual Task<IGeocodingResult?> GetCoordinatesAsync(string? houseNumber, params ICoordinatesResolver[]? coordinatesResolver)

Parameters

houseNumber string

The optional house number to refine the geocoding result.

coordinatesResolver ICoordinatesResolver[]

An array of coordinates resolvers to attempt resolving the address.

Returns

Task<IGeocodingResult>

A task representing the asynchronous operation, with a result of IGeocodingResult if resolved; otherwise, null.

GetHashCode()

public override int GetHashCode()

Returns

int

PrintMembers(StringBuilder)

protected virtual bool PrintMembers(StringBuilder builder)

Parameters

builder StringBuilder

Returns

bool

ToString()

public override string ToString()

Returns

string

ToString(string, string?)

Returns a string that represents the current address based on the specified format.

public string ToString(string format, string? houseNumber = null)

Parameters

format string

Use "s" for short, the "l" format (long) includes additional address components. "td" is also available for "top-down".

houseNumber string

Place the house number inside the address, if applicable.

Returns

string

A string containing the address components based on the specified format.

TryResolveCountryFromIsoAlpha2(string?)

public static Country? TryResolveCountryFromIsoAlpha2(string? isoAlpha2)

Parameters

isoAlpha2 string

Returns

Country?

Operators

operator ==(Address?, Address?)

public static bool operator ==(Address? left, Address? right)

Parameters

left Address
right Address

Returns

bool

operator !=(Address?, Address?)

public static bool operator !=(Address? left, Address? right)

Parameters

left Address
right Address

Returns

bool