internal static DM.Book Build(SM.Book book) { if (book != null) { List <DM.Creator> creators = new List <DM.Creator>(); creators.AddRange(book.Authors != null ? book.Authors.Select(x => Build(x, DE.CreatorType.Author)).ToList() : new List <DM.Creator>()); creators.AddRange(book.Translators != null ? book.Translators.Select(x => Build(x, DE.CreatorType.Translator)).ToList() : new List <DM.Creator>()); creators.AddRange(book.Editors != null ? book.Editors.Select(x => Build(x, DE.CreatorType.Editor)).ToList() : new List <DM.Creator>()); creators.AddRange(book.CollectionEditors != null ? book.CollectionEditors.Select(x => Build(x, DE.CreatorType.CollectionEditor)).ToList() : new List <DM.Creator>()); return(new DM.Book() { TitleFull = book.TitleFull, TitleShort = book.TitleShort, Creators = creators, AccessedDate = Build(book.AccessedDate), IssuedDate = Build(book.IssuedDate), Abstract = book.Abstract, Language = book.Language, Note = book.Note, URL = book.URL, PublisherName = book.PublisherName, PublisherLocation = book.PublisherLocation, ISBN = book.ISBN, CallNumber = book.CallNumber, ArchiveName = book.ArchiveName, ArchiveLocation = book.ArchiveLocation, CollectionTitle = book.CollectionTitle, CollectionNumber = book.CollectionNumber, Edition = book.Edition, VolumeNumber = book.VolumeNumber, VolumeCount = book.VolumeCount, Source = book.Source, EventPlace = book.EventPlace, PageCount = book.PageCount }); } else { return(null); } }
public SM.Citation Book(SE.Style style, SE.Format format, [FromBody] SM.Book book) { return(_citationManager.CreateCitationBook(style, format, book)); }
internal SM.Citation CreateCitationBook(SE.Style style, SE.Format format, SM.Book book) { return(ContentItemFactory.Build(_citationProcessor.CreateCitationBook(ContentItemFactory.Build(style), ContentItemFactory.Build(format), ContentItemFactory.Build(book)))); }