Class Address
- Namespace
- SIMDispatcher.Core.Models
- Assembly
- SIMDispatcher.Core.dll
Represents a specific address within a district, providing detailed street-level information. This record extends the AddressDistrict to include street name and potential street number ranges, which can be used to generate random house numbers within simulations.
public record Address : AddressDistrict, IComparable<AddressState>, IEquatable<AddressState>, IComparable<AddressCommune>, IEquatable<AddressCommune>, IComparable<AddressCity>, IEquatable<AddressCity>, IComparable<AddressDistrict>, IEquatable<AddressDistrict>, IComparable<Address>, IComparable, IEquatable<Address>
- Inheritance
-
Address
- Implements
- Inherited Members
Properties
Id
The unique identifier for this specific address.
public long Id { get; set; }
Property Value
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
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?
Timestamp
Indicates how old the data record is if it comes from cache.
public DateTimeOffset? Timestamp { get; set; }
Property Value
Methods
CompareTo(Address?)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(Address? other)
Parameters
other
AddressAn object to compare with this instance.
Returns
- int
A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value Meaning Less than zero This instance precedes other
in the sort order.Zero This instance occurs in the same position in the sort order as other
.Greater than zero This instance follows other
in the sort order.
CompareTo(object?)
Compares the current instance with another object of the same type and returns an integer that indicates whether the current instance precedes, follows, or occurs in the same position in the sort order as the other object.
public int CompareTo(object? obj)
Parameters
obj
objectAn object to compare with this instance.
Returns
- int
A value that indicates the relative order of the objects being compared. The return value has these meanings:
Value Meaning Less than zero This instance precedes obj
in the sort order.Zero This instance occurs in the same position in the sort order as obj
.Greater than zero This instance follows obj
in the sort order.
Exceptions
- ArgumentException
obj
is not the same type as this instance.
ToString()
Returns a string that represents the current address in a default format.
public override string ToString()
Returns
- string
A string containing the street, district name, and zip of the address.
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
stringA format string. The "l" format (long) includes additional address components.
houseNumber
stringPlace the house number inside the address, if applicable.
Returns
- string
A string containing the address components based on the specified format.