public BookCreate GetBookEdit(Guid bookId) { SBook book = GetSingle(bookId); var bookEdit = BuidBookCreate(book.CategoryId, book.EditorId, book.FirmId); bookEdit.Book = book; return(bookEdit); }
public BookDetails GetDetails(Guid id) { SBook book = GetSingle(id); var model = new BookDetails { Book = book, Responsabilities = ResponsabilityRepository.GetList(r => r.BookId == book.Id).Select(SResponsability.DtoS).ToList(), Notes = NoteRepository.GetList(n => n.BookId == book.Id).Select(SNote.DtoS).ToList() }; return(model); }
private DBook StoD(SBook book) { return(new DBook { Id = book.Id, Title = book.Title, Description = book.Description, NumberOfPages = book.NumberOfPages, ReleaseDate = book.ReleaseDate, FirmId = book.FirmId, EditorId = book.EditorId, CategoryId = book.CategoryId }); }
public void Update(SBook author) { BookRepository.Update(StoD(author)); }
public void Add(SBook author) { BookRepository.Add(StoD(author)); }