/// <summary> /// Resolve the properties of the current <see cref="ChangeProposal"/> from its <see cref="DTO.Thing"/> counter-part /// </summary> /// <param name="dtoThing">The source <see cref="DTO.Thing"/></param> internal override void ResolveProperties(DTO.Thing dtoThing) { if (dtoThing == null) { throw new ArgumentNullException("dtoThing"); } var dto = dtoThing as DTO.ChangeProposal; if (dto == null) { throw new InvalidOperationException(string.Format("The DTO type {0} does not match the type of the current ChangeProposal POCO.", dtoThing.GetType())); } this.ApprovedBy.ResolveList(dto.ApprovedBy, dto.IterationContainerId, this.Cache); this.Author = this.Cache.Get <Participant>(dto.Author, dto.IterationContainerId) ?? SentinelThingProvider.GetSentinel <Participant>(); this.Category.ResolveList(dto.Category, dto.IterationContainerId, this.Cache); this.ChangeRequest = this.Cache.Get <ChangeRequest>(dto.ChangeRequest, dto.IterationContainerId) ?? SentinelThingProvider.GetSentinel <ChangeRequest>(); this.Classification = dto.Classification; this.Content = dto.Content; this.CreatedOn = dto.CreatedOn; this.Discussion.ResolveList(dto.Discussion, dto.IterationContainerId, this.Cache); this.ExcludedDomain.ResolveList(dto.ExcludedDomain, dto.IterationContainerId, this.Cache); this.ExcludedPerson.ResolveList(dto.ExcludedPerson, dto.IterationContainerId, this.Cache); this.LanguageCode = dto.LanguageCode; this.ModifiedOn = dto.ModifiedOn; this.Owner = this.Cache.Get <DomainOfExpertise>(dto.Owner, dto.IterationContainerId) ?? SentinelThingProvider.GetSentinel <DomainOfExpertise>(); this.PrimaryAnnotatedThing = (dto.PrimaryAnnotatedThing.HasValue) ? this.Cache.Get <ModellingThingReference>(dto.PrimaryAnnotatedThing.Value, dto.IterationContainerId) : null; this.RelatedThing.ResolveList(dto.RelatedThing, dto.IterationContainerId, this.Cache); this.RevisionNumber = dto.RevisionNumber; this.ShortName = dto.ShortName; this.SourceAnnotation.ResolveList(dto.SourceAnnotation, dto.IterationContainerId, this.Cache); this.Status = dto.Status; this.ThingPreference = dto.ThingPreference; this.Title = dto.Title; this.ResolveExtraProperties(); }