Show / Hide Table of Contents

Class Address

Address of creditor or debtor.

You can either set street, house number, postal code and town (type structured address) or address line 1 and 2 (type combined address elements). The type is automatically set once any of these fields is set. Before setting the fields, the address type is undetermined. If fields of both types are set, the address type becomes conflicting. Name and country code must always be set unless all fields are empty.

Banks will no longer accept payments using the combined address elements starting November 21, 2025. Therefore, it is recommended to use structured addresses immediately.

Inheritance
object
Address
Implements
IEquatable<Address>
Inherited Members
object.Equals(object, object)
object.GetType()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Codecrete.SwissQRBill.Generator
Assembly: Codecrete.SwissQRBill.Core.dll
Syntax
public sealed class Address : IEquatable<Address>

Properties

| Edit this page View Source

AddressLine1

Gets or sets the address line 1.

Address line 1 contains street name, house number or P.O. box.

Setting this field sets the address type to CombinedElements unless it's already Structured, in which case it becomes Conflicting.

This field is only used for combined address elements and is optional. Starting November 25, 2025, banks will no longer accept payments using combined address elements.

Declaration
[Obsolete("Use a structured address instead. Will be removed in version 4.")]
public string AddressLine1 { get; set; }
Property Value
Type Description
string

The address line 1.

| Edit this page View Source

AddressLine2

Gets or sets the address line 2.

Address line 2 contains postal code and town.

Setting this field sets the address type to CombinedElements unless it's already Structured, in which case it becomes Conflicting.

This field is only used for combined address elements. For this type, it is mandatory. Starting November 25, 2025, banks will no longer accept payments using combined address elements.

Declaration
[Obsolete("Use a structured address instead. Will be removed in version 4.")]
public string AddressLine2 { get; set; }
Property Value
Type Description
string

The address line 2.

| Edit this page View Source

CountryCode

Gets or sets the two-letter ISO country code.

The country code is mandatory unless the entire address contains null or empty values.

Declaration
public string CountryCode { get; set; }
Property Value
Type Description
string

The ISO country code.

| Edit this page View Source

HouseNo

Gets or sets the house number.

Setting this field sets the address type to Structured unless it's already CombinedElements, in which case it becomes Conflicting.

This field is only used for structured addresses and is optional.

Declaration
public string HouseNo { get; set; }
Property Value
Type Description
string

The house number.

| Edit this page View Source

Name

Gets or sets the name, either the first and last name of a natural person or the company name of a legal person.

Declaration
public string Name { get; set; }
Property Value
Type Description
string

The name.

| Edit this page View Source

PostalCode

Gets or sets the postal code.

Setting this field sets the address type to Structured unless it's already CombinedElements, in which case it becomes Conflicting.

This field is only used for structured addresses. For this type, it's mandatory.

Declaration
public string PostalCode { get; set; }
Property Value
Type Description
string

The postal code.

| Edit this page View Source

Street

Gets or sets the street.

The street must be specified without house number.

Setting this field sets the address type to Structured unless it's already CombinedElements, in which case it becomes Conflicting.

This field is only used for structured addresses and is optional.

Declaration
public string Street { get; set; }
Property Value
Type Description
string

The street.

| Edit this page View Source

Town

Gets or sets the town or city.

Setting this field sets the address type to Structured unless it's already CombinedElements, in which case it becomes Conflicting.

This field is only used for structured addresses. For this type, it's mandatory.

Declaration
public string Town { get; set; }
Property Value
Type Description
string

The town or city.

| Edit this page View Source

Type

Gets the address type.

The address type is automatically set by either setting street / house number or address line 1 and 2. Before setting the fields, the address type is Undetermined. If fields of both types are set, the address type becomes Conflicting.

Declaration
public Address.AddressType Type { get; }
Property Value
Type Description
Address.AddressType

The address type.

Methods

| Edit this page View Source

Clear()

Clears all fields and sets the type to Undetermined.

Declaration
public void Clear()
| Edit this page View Source

Equals(Address)

Determines whether the specified address is equal to the current address.

Declaration
public bool Equals(Address other)
Parameters
Type Name Description
Address other

The address to compare with the current address.

Returns
Type Description
bool

true if the specified object is equal to the current object; otherwise, false.

| Edit this page View Source

Equals(object)

Determines whether the specified object is equal to the current object.

Declaration
public override bool Equals(object obj)
Parameters
Type Name Description
object obj

The object to compare with the current object.

Returns
Type Description
bool

true if the specified object is equal to the current object; otherwise, false.

Overrides
object.Equals(object)
| Edit this page View Source

GetHashCode()

Gets the hash code for this instance.

Declaration
public override int GetHashCode()
Returns
Type Description
int

A hash code for the current object.

Overrides
object.GetHashCode()

Implements

IEquatable<T>
  • Edit this page
  • View Source
In this article
Back to top Generated by DocFX