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