Address
Record public
Represents a physical or mailing address, decomposed into street, city, state, postal code, and country components.
Definition
Section titled Definitionpublic record Address : System.IEquatable<SampleApi.Address> IEquatable<Address>
Inheritance
Section titled Inheritance IEquatable<Address>
classDiagram
direction TB
class Address {
<<record>>
}
class IEquatable~Address~ {
<<interface>>
}
IEquatable~Address~ <|.. AddressRemarks
Section titled RemarksAddress is a record class providing value-based equality and immutability by default, making it suitable for use as an embedded value object within aggregate roots such as Customer. The
Country field uses ISO 3166-1 alpha-2 codes rather than full country names to ensure consistent, locale-independent storage.Constructors1
Section titled ConstructorsConstructor Section titled Constructor Address.Address( string Street, string City, string State, string PostalCode, string Country)Represents a physical or mailing address, decomposed into street, city, state, postal code, and country components.
Parameters
Street string The street address, including house or building number (e.g.,
"123 Main St"). City string The city or locality name (e.g.,
"Seattle"). State string The state, province, or region (e.g.,
"WA"). PostalCode string The postal or ZIP code (e.g.,
"98101"). Country string The ISO 3166-1 alpha-2 country code (e.g.,
"US", "DE"). Remarks
Address is a record class providing value-based equality and immutability by default, making it suitable for use as an embedded value object within aggregate roots such as Customer. The
Country field uses ISO 3166-1 alpha-2 codes rather than full country names to ensure consistent, locale-independent storage.Examples
Creating an address for a US location:
var address = new Address( Street: "One Microsoft Way", City: "Redmond", State: "WA", PostalCode: "98052", Country: "US");Properties5
Section titled PropertiesCountry Section titled Country string string Address.CountryThe ISO 3166-1 alpha-2 country code (e.g., "US", "DE").
PostalCode Section titled PostalCode string string Address.PostalCodeThe postal or ZIP code (e.g., "98101").
Street Section titled Street string string Address.StreetThe street address, including house or building number (e.g., "123 Main St").
Examples
Section titled ExamplesCreating an address for a US location:
var address = new Address( Street: "One Microsoft Way", City: "Redmond", State: "WA", PostalCode: "98052", Country: "US");