Beispiel #1
0
        /// <summary>
        /// Generates a <see cref="DTO.Thing"/> from the current <see cref="Book"/>
        /// </summary>
        public override DTO.Thing ToDto()
        {
            var dto = new DTO.Book(this.Iid, this.RevisionNumber);

            dto.Category.AddRange(this.Category.Select(x => x.Iid));
            dto.CreatedOn = this.CreatedOn;
            dto.ExcludedDomain.AddRange(this.ExcludedDomain.Select(x => x.Iid));
            dto.ExcludedPerson.AddRange(this.ExcludedPerson.Select(x => x.Iid));
            dto.ModifiedOn     = this.ModifiedOn;
            dto.Name           = this.Name;
            dto.Owner          = this.Owner != null ? this.Owner.Iid : Guid.Empty;
            dto.RevisionNumber = this.RevisionNumber;
            dto.Section.AddRange(this.Section.ToDtoOrderedItemList());
            dto.ShortName       = this.ShortName;
            dto.ThingPreference = this.ThingPreference;

            dto.IterationContainerId = this.CacheKey.Iteration;
            dto.RegisterSourceThing(this);
            this.BuildDtoPartialRoutes(dto);
            return(dto);
        }
Beispiel #2
0
 public Book(DTO.Book book)
 {
     Id       = book.Id;
     Title    = book.Title;
     AuthorId = book.AuthorId;
 }