public IHttpActionResult PutDisablePost(int id) { Post postToUpdate = postRepo.Get(id); if (postToUpdate != null) { postRepo.DisablePost(id); return(StatusCode(HttpStatusCode.OK)); } else { return(StatusCode(HttpStatusCode.NoContent)); } }