示例#1
0
 public BookDTO(Book book)
 {
     BookID    = book.BookID;
     Title     = book.Title;
     DateWrite = book.DateWrite;
     if (book.author != null)
     {
         author = new AuthorDTO(book.author);
     }
 }
示例#2
0
        public static List <AuthorDTO> ToListAuthorDTO(List <Author> authors)
        {
            List <AuthorDTO> authorsDTO = new List <AuthorDTO>();

            foreach (Author author in authors)
            {
                AuthorDTO authorDTO = new AuthorDTO(author);
                authorDTO.AddBooksAuthor(author);
                authorsDTO.Add(authorDTO);
            }
            return(authorsDTO);
        }