Exemple #1
0
        private AuthorStatistics MapAuthorStatistics(List <BookStatistics> bookStatistics)
        {
            var authorStatistics = new AuthorStatistics
            {
                BookStatistics = bookStatistics,
                BookCount      = bookStatistics.Sum(s => s.BookCount),
                AuthorId       = bookStatistics.First().AuthorId,
                BookFileCount  = bookStatistics.Sum(s => s.BookFileCount),
                SizeOnDisk     = bookStatistics.Sum(s => s.SizeOnDisk)
            };

            return(authorStatistics);
        }
Exemple #2
0
        private AuthorStatistics MapAuthorStatistics(List <BookStatistics> bookStatistics)
        {
            var authorStatistics = new AuthorStatistics
            {
                AuthorId           = bookStatistics.First().AuthorId,
                BookFileCount      = bookStatistics.Sum(s => s.BookFileCount),
                BookCount          = bookStatistics.Sum(s => s.BookCount),
                AvailableBookCount = bookStatistics.Sum(s => s.AvailableBookCount),
                TotalBookCount     = bookStatistics.Sum(s => s.TotalBookCount),
                SizeOnDisk         = bookStatistics.Sum(s => s.SizeOnDisk),
                BookStatistics     = bookStatistics
            };

            return(authorStatistics);
        }