public HttpResponseMessage VoteDown(int id)
{
var found = this.dbContext.CodeJewels.Find(id);
HttpResponseMessage responce;
if (found != null)
{
found.Rating -= 1;
if (found.Rating < -10)
{
this.dbContext.CodeJewels.Remove(found);
}
this.dbContext.SaveChanges();
responce = Request.CreateResponse(HttpStatusCode.OK);
}
else
{
responce = Request.CreateResponse(HttpStatusCode.NotFound);
}
return responce;
}