Пример #1
0
        public async Task DeleteCategoryAsync(CategoryDeletionBindingModel model)
        {
            var category = this.Mapper.Map <Category>(model);

            this.Context.Categories.Remove(category);
            await this.Context.SaveChangesAsync();
        }
Пример #2
0
        public async Task <IActionResult> Delete(CategoryDeletionBindingModel model)
        {
            await this.categoryService.DeleteCategoryAsync(model);

            return(RedirectToAction(AppConstants.IndexRedirect));
        }