added Address CreateFrom helper
All checks were successful
Publish NuGet Packages / build-and-publish (push) Successful in 38s

This commit is contained in:
Mathias Beaulieu-Duncan 2025-10-08 11:29:16 -04:00
parent 075a803f4f
commit 854658f732

View File

@ -15,4 +15,19 @@ public record Address(bool Normalized = false) : IAddress
public GeoPoint? Location { get; set; }
public string? Note { get; set; }
public bool IsNormalized() => Normalized;
public static Address CreateFrom(IAddress address, GeoPoint? location = null, string? note = null, bool normalized = false)
{
return new Address(normalized)
{
Line1 = address.Line1,
Line2 = address.Line2,
City = address.City,
Subdivision = address.Subdivision,
PostalCode = address.PostalCode,
Country = address.Country,
Location = location,
Note = note,
};
}
}