public Manga UpdateManga(Manga changedManga)
        {
            var manga = _context.Mangas.Attach(changedManga);

            manga.State = EntityState.Modified;
            _context.SaveChanges();
            return(changedManga);
        }
        public Manga DeleteManga(int id)
        {
            Manga manga = _context.Mangas.Find(id);

            if (manga != null)
            {
                foreach (var mangaChapter in GetAllChapters(id))
                {
                    DeleteChapter(mangaChapter.Id);
                }
                _context.Mangas.Remove(manga);
                _context.SaveChanges();
            }

            return(manga);
        }
 public Manga AddManga(Manga manga)
 {
     _context.Mangas.Add(manga);
     _context.SaveChanges();
     return(manga);
 }