Partial Entity Updates in WebAPI PUT/POST
问题 Say you have a repository method to update a Document: public Document UpdateDocument(Document document) { Document serverDocument = _db.Documents.Find(document.Id); serverDocument.Title = document.Title; serverDocument.Content = document.Content; _db.SaveChanges(); return serverDocument; } In this case, the entity has two properties. When updating a Document, both of these properties are required in the JSON request, so a request to PUT /api/folder with a body of { "documentId" = "1", "title