예제 #1
0
 public dynamic AddBook(BooksDTO NewBook)
 {
     try
     {
         var Book = new BooksBO();
         Book.Name       = NewBook.Name;
         Book.NumPages   = NewBook.NumPages;
         Book.PublicDate = NewBook.PublicDate.ToUniversalTime();
         Book.Authors    = new List <BusinessObjects.Authors.AuthorsBO>();
         Book.Authors    = NewBook.Authors.Select(x => new BusinessObjects.Authors.AuthorsBO()
         {
             AuthorName = x.AuthorName
         }).ToList();
         var Data = base.AddBook(Book);
         if (Data != null)
         {
             return(Data);
         }
         else
         {
             return("Invalid Data");
         }
     }
     catch (Exception ex)
     {
         return("Invalid");
     }
 }