public int AddBook(ServiceBook book) { int id = unit.Books.Create(book.ToDalBook()); unit.Save(); return(id); }
public ServiceFullBook GetFullBookInfo(ServiceBook book) { var dalBook = book.ToDalBook(); ServiceFullBook fBook = new ServiceFullBook { BookData = book, Authors = unit.Books.GetAuthors(dalBook).Select(e => e.ToServiceAuthor()), Comments = unit.Comments.FindAll(e => e.BookID == dalBook.ID).Select(e => e.ToServiceComment()), Contents = unit.Contents.FindAll(e => e.BookID == dalBook.ID).Select(e => e.ToServiceContent()), Likes = unit.Likes.FindAll(e => e.BookID == dalBook.ID).Select(e => e.ToServiceLike()), Lists = unit.Books.GetLists(dalBook).Select(e => e.ToServiceList()), Review = unit.Reviews.FindAll(e => e.BookID == dalBook.ID).Select(e => e.ToServiceReview()), Covers = unit.Books.GetCovers(dalBook).Select(e => e.ToServiceCover()), Files = unit.Books.GetFiles(dalBook).Select(e => e.ToServiceFile()), Genres = unit.Books.GetGenres(dalBook).Select(e => e.ToServiceGenre()), Screeninigs = unit.Books.GetScreenings(dalBook).Select(e => e.ToServiceScreening()), Tags = unit.Books.GetTags(dalBook).Select(e => e.ToServiceTag()) }; return(fBook); }
public void AddBookTag(ServiceBook book, ServiceTag tag) { unit.Books.AddTag(book.ToDalBook(), tag.ToDalTag()); unit.Save(); }
public void AddBookGenre(ServiceBook book, ServiceGenre genre) { unit.Books.AddGenre(book.ToDalBook(), genre.ToDalGenre()); unit.Save(); }
public void RemoveListBook(ServiceList list, ServiceBook book) { unit.Lists.DeleteBook(list.ToDalList(), book.ToDalBook()); unit.Save(); }
public void RemoveBookTag(ServiceBook book, ServiceTag tag) { unit.Books.DeleteTag(book.ToDalBook(), tag.ToDalTag()); unit.Save(); }
public void RemoveBookGenre(ServiceBook book, ServiceGenre genre) { unit.Books.DeleteGenre(book.ToDalBook(), genre.ToDalGenre()); unit.Save(); }
public void UpdateBook(ServiceBook book) { unit.Books.Update(book.ToDalBook()); unit.Save(); }
public void AddAuthorBook(ServiceAuthor author, ServiceBook book) { unit.Books.AddAuthor(book.ToDalBook(), author.ToDalAuthor()); unit.Save(); }
public IEnumerable <ServiceCover> GetBookCovers(ServiceBook book) { return(unit.Books.GetCovers(book.ToDalBook())?.Select(e => e.ToServiceCover())); }
public IEnumerable <ServiceAuthor> GetBookAuthors(ServiceBook book) { return(unit.Books.GetAuthors(book.ToDalBook()).Select(e => e.ToServiceAuthor())); }
public void AddScreening(ServiceBook book, ServiceScreening screening) { unit.Books.AddScreening(book.ToDalBook(), screening.ToDalScreening()); unit.Save(); }
public void AddFile(ServiceBook book, ServiceFile file) { unit.Books.AddFile(book.ToDalBook(), file.ToDalFile()); unit.Save(); }
public void AddCover(ServiceBook book, ServiceCover cover) { unit.Books.AddCover(book.ToDalBook(), cover.ToDalCover()); unit.Save(); }
public void AddListBook(ServiceList list, ServiceBook book) { unit.Lists.AddBook(list.ToDalList(), book.ToDalBook()); unit.Save(); }
public void AddBook(ServiceCollection collection, ServiceBook book) { unit.Collections.AddBook(collection.ToDalCollection(), book.ToDalBook()); unit.Save(); }
public IEnumerable <ServiceFile> GetBookFiles(ServiceBook book) { return(unit.Books.GetFiles(book.ToDalBook())?.Select(e => e.ToServiceFile())); }
public void RemoveAuthorBook(ServiceAuthor author, ServiceBook book) { unit.Books.DeleteAuthor(book.ToDalBook(), author.ToDalAuthor()); unit.Save(); }
public void RemoveBook(ServiceBook book) { unit.Books.Delete(book.ToDalBook()); unit.Save(); }