public PersonAddressState GetSerializableState(PersonState personState) { return(new PersonAddressState { Id = _id, PostCode = PostCode, Person = personState }); }
internal Person(PersonState personState) { Id = personState.Id; Version = personState.Version; _firstName = personState.FirstName; _lastName = personState.LastName; _personAddress = new PersonAddress(personState.PersonAddressState); _jobs = personState.Jobs.Select(x => new Job(x)).ToList(); }
internal JobState GetJobState(PersonState personState) { return(new JobState { Id = _id, StartDate = _startDate, EndDate = _endDate, JobTitle = _jobTitle, PersonState = personState }); }
public IAggregateState GetState() { PersonState aggregateState = new PersonState { Id = Id, Version = Version, AggregateRoot = this, FirstName = _firstName, LastName = _lastName, }; aggregateState.Jobs = _jobs.Select(x => x.GetJobState(aggregateState)).ToList(); aggregateState.PersonAddressState = _personAddress.GetSerializableState(aggregateState); return(aggregateState); }