Пример #1
0
        //[ValidateAntiForgeryToken]
        public async Task <IActionResult> DeleteCategory(string CategoryId)
        {
            int intCategoryId  = Convert.ToInt32(CategoryId);
            var CategoryEntity = await categoryBusinessLogic.GetCategoryById(intCategoryId);

            await categoryBusinessLogic.DeleteCategory(CategoryEntity);

            var categories    = categoryBusinessLogic.GetAllCategories().Result;
            var categoryModel = mapCategoryEntityToModel.ConvertObjectCollection(categories);

            return(Json(new { html = Helper.RenderRazorViewToString(this, "_ViewAllCategory", categoryModel) }));
        }
Пример #2
0
        public IHttpActionResult DeleteCategory(DeleteCategoryRequest request)
        {
            var result = _businessLogic.DeleteCategory(request);

            return(new ActionResult <bool>(result.Result, Request));
        }