public async Task DeleteCategoryAsync(CategoryDeletionBindingModel model) { var category = this.Mapper.Map <Category>(model); this.Context.Categories.Remove(category); await this.Context.SaveChangesAsync(); }
public async Task <IActionResult> Delete(CategoryDeletionBindingModel model) { await this.categoryService.DeleteCategoryAsync(model); return(RedirectToAction(AppConstants.IndexRedirect)); }