Beispiel #1
0
        public ActionResult InsertComic(ComicBookForInsert dto)
        {
            Entities.ComicBook comicBook = new Entities.ComicBook();
            comicBook.Description = dto.Description;
            comicBook.Issue       = dto.Issue;
            comicBook.ReleaseDate = dto.ReleaseDate;
            comicBook.Title       = dto.Title;

            _comicBookRepository.Insert(comicBook);
            _comicBookRepository.SaveChanges();

            return(Ok());
        }
Beispiel #2
0
        public ActionResult UpdateComic(int id, ComicBookForUpdate dto)
        {
            Entities.ComicBook comicBook = new Entities.ComicBook();

            comicBook.Description = dto.Description;
            comicBook.Title       = dto.Title;

            if (!_comicBookRepository.Exists(id))
            {
                return(NotFound());
            }

            _comicBookRepository.Update(id, comicBook);
            return(NoContent());
        }