Я хочу использовать метод исправления для замены заголовка, но я получаю «500 Internal Server Error».
Метод: url: http://localhost:6637/api/gym/management/classes/update/26
Headers : Content-Type : application/json-patch+json
[{
"op" : "replace",
"path" : "http://localhost:6637/api/gym/management/classes/update/26/",
"value" : ["Title":"Ginger Nut" ]
}]
Данные:
{
"id": 26,
"sportTypeTitle": "بدنسازی",
"sportTypeId": 2,
"participantTypeTitle": "عمومی",
"participantTypeId": 2,
"sessionTypeTitle": "ماهانه",
"sessionTypeId": 1,
"salonTitle": "سالن شماره 1 بدنسازی",
"salonId": 2,
"title": "TRX 2",
"registeredDate": "1398/7/22-17:20",
"capacity": 20,
"cost": 2000000.00,
"costFormatted": "2,000,000ريال",
"sessionsCount": 0,
"scheduleStart": "1398/7/9-0:0",
"scheduleEnd": "1398/8/10-0:0",
"classState": 1,
"classStateTitle": "با برنامه",
"activeState": 1,
"activeStateTitle": "فعال",
"rowNumber": 0
}
c # Метод API:
[AllowAnonymous]
[Route("update/{id:int}")]
[HttpPatch]
public IHttpActionResult Update([FromBody]
JsonPatch.JsonPatchDocument<ClassPatchDto> patchDoc, int id){
return ok
}