Esempio n. 1
0
 static private BusinessDetailsDTO FromBook(BookBusiness business, DateTimeOffset availabilityCheckMoment)
 {
     Debug.Assert(business != null, "business != null");
     Debug.Assert(business.BookTemplate != null, "business.BookTemplate != null");
     return(new BusinessDetailsDTO
     {
         ISBN = business.BookTemplate.Publication?.ISBN,
         Publisher = business.BookTemplate.Publication?.Publisher?.Name,
         PublicationDate = business.BookTemplate.Publication?.PublicationDate,
         Title = business.BookTemplate.Title?.Caption,
         Authors = business.BookTemplate.Authors?.Select(a => a.FullName)?.ToArray(),
         Genres = business.BookTemplate.Genres?.Select(a => a.Caption)?.ToArray(),
         Availability = business.GetBookAvailabilities(availabilityCheckMoment).Select(AvailabilityDetailsDTO.FromAvailability)
     });
 }
Esempio n. 2
0
 static internal BusinessDetailsDTO FromBook(BookBusiness business)
 {
     return(FromBook(business, DateTimeOffset.Now));
 }