public void AddGenre(AreaFilmflixCategory model) { var result = _mapper.Map <ClamUserFilmCategory>(model); _context.ClamUserFilmCategories.Add(result); _context.SaveChanges(); }
public async Task AddAsyncGenre(AreaFilmflixCategory model) { var result = _mapper.Map <ClamUserFilmCategory>(model); await _context.ClamUserFilmCategories.AddAsync(result); await _context.SaveChangesAsync(); }
public async Task <IActionResult> PostUploadCategory(AreaFilmflixCategory model) { try { await _unitOfWork.FilmControl.AddAsyncGenre(model); _unitOfWork.Complete(); return(RedirectToAction(nameof(Category))); } catch { return(View()); } }