public void NewAddress(int streetNumber, string streetName, string city, string state, string zip) { if(CurrentAddress != null) { FormerAddresses.Add( CurrentAddress ); } CurrentAddress = new Address(streetNumber, streetName, city, state, zip); }
public void PopulateFromMemento(IDriverMemento memento) { SSN = memento.SSN; FirstName = memento.FirstName; LastName = memento.LastName; DateOfBirth = memento.DateOfBirth; CurrentAddress = new Address( memento.CurrentAddress ); FormerAddresses = memento.FormerAddresses.Select( x => new Address( x ) ).ToList(); Vehicles = memento.Vehicles.Select( x => new Vehicle( x ) ).ToList(); }