public PersonAddressState GetSerializableState(PersonState personState)
 {
     return(new PersonAddressState
     {
         Id = _id,
         PostCode = PostCode,
         Person = personState
     });
 }
Beispiel #2
0
        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();
        }
Beispiel #3
0
 internal JobState GetJobState(PersonState personState)
 {
     return(new JobState
     {
         Id = _id,
         StartDate = _startDate,
         EndDate = _endDate,
         JobTitle = _jobTitle,
         PersonState = personState
     });
 }
Beispiel #4
0
        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);
        }