Пример #1
0
        public void AddGenre(AreaFilmflixCategory model)
        {
            var result = _mapper.Map <ClamUserFilmCategory>(model);

            _context.ClamUserFilmCategories.Add(result);
            _context.SaveChanges();
        }
Пример #2
0
        public async Task AddAsyncGenre(AreaFilmflixCategory model)
        {
            var result = _mapper.Map <ClamUserFilmCategory>(model);
            await _context.ClamUserFilmCategories.AddAsync(result);

            await _context.SaveChangesAsync();
        }
Пример #3
0
        public async Task <IActionResult> PostUploadCategory(AreaFilmflixCategory model)
        {
            try
            {
                await _unitOfWork.FilmControl.AddAsyncGenre(model);

                _unitOfWork.Complete();
                return(RedirectToAction(nameof(Category)));
            }
            catch
            {
                return(View());
            }
        }