public HttpResponseMessage ShowSoldHistory(int id) { List <spDisplaySoldHistory_Result> soldcrops = new List <spDisplaySoldHistory_Result>(); soldcrops = entities.spDisplaySoldHistory(id).ToList(); if (soldcrops.Count == 0) { return(Request.CreateErrorResponse(HttpStatusCode.NotFound, "No Sold Crops!")); } return(Request.CreateResponse <IEnumerable <spDisplaySoldHistory_Result> >(HttpStatusCode.OK, soldcrops)); }