public async Task AddAsyncGenre(AreaUserMusicCategory model) { var result = _mapper.Map <ClamUserMusicCategory>(model); await _context.ClamUserMusicCategories.AddAsync(result); await _context.SaveChangesAsync(); }
public void AddGenre(AreaUserMusicCategory model) { var result = _mapper.Map <ClamUserMusicCategory>(model); _context.ClamUserMusicCategories.Add(result); _context.SaveChangesAsync(); }
public async Task <IActionResult> CreateGenre(AreaUserMusicCategory model) { try { await _unitOfWork.MusicControl.AddAsyncGenre(model); _unitOfWork.Complete(); return(RedirectToAction(nameof(Category))); } catch (Exception) { return(View()); } }