47 lines
1.1 KiB
C#
47 lines
1.1 KiB
C#
using System.ComponentModel.DataAnnotations;
|
|
using Landmark.OLA.Models.Addresses.Enums;
|
|
|
|
namespace Landmark.OLA.Models.Addresses
|
|
{
|
|
public class Address : IAddress
|
|
{
|
|
[Required]
|
|
[StringLength(40)]
|
|
public string Address1 { get; set; }
|
|
|
|
[StringLength(40)]
|
|
public string Address2 { get; set; }
|
|
|
|
[Required]
|
|
[StringLength(100)]
|
|
public string City { get; set; }
|
|
|
|
[Required]
|
|
//Nullable so that there is no default value
|
|
public StateOption? State { get; set; }
|
|
|
|
[Required]
|
|
[StringLength(5, MinimumLength = 5)]
|
|
public string PostalCode { get; set; }
|
|
|
|
[StringLength(4, MinimumLength = 4)]
|
|
public string PostalCodeExt { get; set; }
|
|
|
|
[Required]
|
|
//Nullable so that there is no default value.
|
|
public CountryOption? Country { get; set; }
|
|
|
|
public Guid Id { get; private set; }
|
|
|
|
public Address()
|
|
{
|
|
Id = Guid.NewGuid();
|
|
}
|
|
|
|
public Address(Guid id)
|
|
{
|
|
Id = id;
|
|
}
|
|
}
|
|
}
|