SenseNet / sn-client-dotnet

A .Net client for sensenet that makes it easy to use the REST API of the Content Repository.
https://www.sensenet.com/
GNU General Public License v2.0
7 stars 16 forks source link

Too many fields are updated but only one field modified #141

Closed kavics closed 1 month ago

kavics commented 2 months ago

Too many fields are in the PATCH request when a content's one field was edited.

var content = await repository.LoadContentAsync("/Root/Content/Cars/AAXX123", cancel);
content["Color"] = "Rosso Corsa";
await content.SaveAsync(cancel);

But currently generated this request:

PATCH https://localhost:44362/OData.svc/content(1412)?metadata=no
models=[{
  "Name":"AAXX123",
  "Color":"Nero Daytona",
  "Description":null,
  "CreationDate":"2024-06-06T14:38:17.99Z",
  "ModificationDate":"2024-06-06T14:38:18Z",
  "VersionCreationDate":"2024-06-06T14:38:17.99Z",
  "VersionModificationDate":"2024-06-06T14:38:18Z",
  "VersioningMode":["0"],
  "InheritableVersioningMode":["0"],
  "ApprovingMode":["0"],
  "InheritableApprovingMode":["0"],
  "CheckInComments":null,
  "RejectReason":null,
  "Versions":null,
  "EnableLifespan":false,
  "ValidFrom":"2024-06-06T14:38:17Z",
  "ValidTill":"2024-06-06T14:38:17Z",
  "Hidden":false,"IsFolder":false,
  "IsSystemContent":false,
  "Locked":false,
  "Tags":null,
  "TrashDisabled":false
}] 

The expectation:

PATCH https://localhost:44362/OData.svc/content(1412)?metadata=no
models=[{
  "Color":"Rosso Corsa",
}]