public HttpResponseMessage Delete(int id) { var product = WoodDB.Product.FirstOrDefault(x => x.Id == id); if (product == null) { throw new ArgumentNullException(); } WoodDB.Product.Remove(product); return(ToJson(WoodDB.SaveChanges())); }
public HttpResponseMessage Put(int id, [FromBody] Product value) { WoodDB.Entry(value).State = EntityState.Modified; return(ToJson(WoodDB.SaveChanges())); }