2017-02-08 19:26:05 +01:00
|
|
|
|
using Microsoft.eShopOnContainers.Services.Ordering.Domain.SeedWork;
|
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
2016-11-21 12:41:36 +01:00
|
|
|
|
|
2017-01-25 17:10:08 +01:00
|
|
|
|
namespace Microsoft.eShopOnContainers.Services.Ordering.Domain.AggregatesModel.OrderAggregate
|
|
|
|
|
{
|
2017-11-07 10:51:35 -08:00
|
|
|
|
public class Address : ValueObject
|
2016-11-21 12:41:36 +01:00
|
|
|
|
{
|
2018-10-05 09:46:19 +01:00
|
|
|
|
public String Street { get; private set; }
|
|
|
|
|
public String City { get; private set; }
|
|
|
|
|
public String State { get; private set; }
|
|
|
|
|
public String Country { get; private set; }
|
|
|
|
|
public String ZipCode { get; private set; }
|
2016-11-21 12:41:36 +01:00
|
|
|
|
|
2019-08-12 08:27:19 +02:00
|
|
|
|
public Address() { }
|
2017-05-18 11:42:22 +02:00
|
|
|
|
|
2017-01-25 17:10:08 +01:00
|
|
|
|
public Address(string street, string city, string state, string country, string zipcode)
|
|
|
|
|
{
|
|
|
|
|
Street = street;
|
|
|
|
|
City = city;
|
|
|
|
|
State = state;
|
|
|
|
|
Country = country;
|
|
|
|
|
ZipCode = zipcode;
|
|
|
|
|
}
|
2017-02-08 19:26:05 +01:00
|
|
|
|
|
2020-08-25 11:52:08 +01:00
|
|
|
|
protected override IEnumerable<object> GetEqualityComponents()
|
2017-02-08 19:26:05 +01:00
|
|
|
|
{
|
2017-11-07 10:56:46 -08:00
|
|
|
|
// Using a yield return statement to return each element one at a time
|
2017-02-08 19:26:05 +01:00
|
|
|
|
yield return Street;
|
|
|
|
|
yield return City;
|
|
|
|
|
yield return State;
|
|
|
|
|
yield return Country;
|
|
|
|
|
yield return ZipCode;
|
|
|
|
|
}
|
2016-11-21 12:41:36 +01:00
|
|
|
|
}
|
|
|
|
|
}
|