public async Task <HttpResponseMessage> DeleteCategory(Int32 id) { var response = new SingleModelResponse <CategoryViewModel>() as ISingleModelResponse <CategoryViewModel>; try { var entity = await Task.Run(() => { return(BusinessObject.DeleteCategory(new Category(id))); }); response.Model = new CategoryViewModel(entity); } catch (Exception ex) { ExceptionHelper.Publish(ex); response.DidError = true; response.ErrorMessage = ex.Message; } return(response.ToHttpResponse(Request)); }