public HttpResponseMessage Put([FromBody] ProductCatalogDA.Product product) { try { using (ProductCatalogDA.CATALOGEntities db = new ProductCatalogDA.CATALOGEntities()) { product.ChangeDate = DateTime.Now; db.Products.Attach(product); var entry = db.Entry(product); entry.Property(e => e.BrandID).IsModified = true; entry.Property(e => e.ChangeDate).IsModified = true; entry.Property(e => e.Name).IsModified = true; entry.Property(e => e.Size).IsModified = true; entry.Property(e => e.StockQuantity).IsModified = true; entry.Property(e => e.UnitPrice).IsModified = true; // other changed properties db.SaveChanges(); return Request.CreateResponse(HttpStatusCode.OK, "Operation Sucessful"); } } catch (Exception e) { return Request.CreateResponse(HttpStatusCode.InternalServerError, e.Message.ToString()); } }