コード例 #1
0
        public async Task <ActionResult> Delete(CategoryViewModel categoryViewModel)
        {
            try
            {
                if (ModelState.IsValid)
                {
                    CategoryViewModel result = await categoryBLL.DeleteCategoryAsync(categoryViewModel);

                    if (result != null)
                    {
                        return(Ok(new { status = 200, message = "Category Deleted succesfull.", obj = result }));
                    }
                }
            }
            catch (Exception e)
            {
            }
            return(BadRequest(new { status = 400, message = "Sorry! Something went wrong please try again" }));
        }