Пример #1
0
 public void DeleteBook([FromBody] BookEditorResource resource)
 {
     foreach (var bookId in resource.BookIds)
     {
         _bookService.DeleteBook(bookId, resource.DeleteFiles ?? false, resource.AddImportListExclusion ?? false);
     }
 }
Пример #2
0
        public IActionResult SaveAll([FromBody] BookEditorResource resource)
        {
            var booksToUpdate = _bookService.GetBooks(resource.BookIds);

            foreach (var book in booksToUpdate)
            {
                if (resource.Monitored.HasValue)
                {
                    book.Monitored = resource.Monitored.Value;
                }
            }

            _bookService.UpdateMany(booksToUpdate);
            return(Accepted(booksToUpdate.ToResource()));
        }