Пример #1
0
 // DELETE /api/categories/5
 public void Delete(int id)
 {
     var command = new DeleteCategoryCommand { CategoryId = id };
     var result = commandBus.Submit(command);
     if (!result.Success)
         throw new HttpResponseException(HttpStatusCode.BadRequest);
 }
Пример #2
0
 public ActionResult Delete(int id)
 {
     var command = new DeleteCategoryCommand { CategoryId = id };
     var result = commandBus.Submit(command);
     var categories = categoryRepository.GetAll();
     return PartialView("_CategoryList", categories);
 }
Пример #3
0
 // DELETE /api/category/5
 public HttpResponseMessage Delete(int id)
 {
     var command = new DeleteCategoryCommand { CategoryId = id };
     var result = commandBus.Submit(command);
     if (result.Success)
     {
         return new HttpResponseMessage(HttpStatusCode.NoContent);
     }
         throw new HttpResponseException(HttpStatusCode.BadRequest);
 }