This question is locked. New answers and comments are not allowed.
I use WCF ODATA to communicate with my JavaScript client.
When I do an update operation, the SaveChanges method is called.
The problem is that I also use a ChangeInterceptor for setting a property value on my entity
before saving to DB.
Now the problem is that the SaveChanges method returns void.
It would be great if it could return the actual saved entity
instead so that the client is aware of changes made by the server.
Am I missing something and this is already possible ? Or would that be a change request ?
Thanks
EDIT: When an new entity is inserted, it is actually returned by the server. Only updated entities are not returned.
See the response of the $batch call for an insert:
--batchresponse_7aa4983b-fa44-4254-9013-897f986679ea
Content-Type: multipart/mixed; boundary=changesetresponse_27433a38-8952-42d8-b66b-fb7a27406c90
--changesetresponse_27433a38-8952-42d8-b66b-fb7a27406c90
Content-Type: application/http
Content-Transfer-Encoding: binary
HTTP/1.1 201 Created
DataServiceVersion: 3.0;
Content-Type: application/json;odata=fullmetadata;streaming=true;charset=utf-8
Content-ID: 1
X-Content-Type-Options: nosniff
Cache-Control: no-cache
Location: http://localhost:24497/DirectDebitModelService.svc/Mandates(48)
{"odata.metadata":"http://localhost:24497/DirectDebitModelService.svc/$metadata#Mandates/@Element","odata.type":"DirectDebitModel.Mandate","odata.id":"http://localhost:24497/DirectDebitModelService.svc/Mandates(48)","odata.editLink":"Mandates(48)","OpenPositions@odata.navigationLinkUrl":"Mandates(48)/OpenPositions","AccountOwnerName":"berthelots","AccountOwnerTiersId":225956,"Amendment":0,"BIC":"BCLLLULL","CreatedBy":"berthelots","CreatedDate@odata.type":"Edm.DateTime","CreatedDate":"2013-09-03T10:41:08.697","CreditorType":0,"IBAN":"LU521111000011110000","Id":48,"IsSEPAMandate":false,"MandateReference":"001/257000004","MandateType":0,"NextSequenceType":0,"OldCetrelReference":null,"PlaceOfSignature":null,"PolicyNumber":"257000004","Remarks":null,"RowVersion@odata.type":"Edm.Int64","RowVersion":"6020","SignatureDate":null,"Status":1,"UpdatedBy":null,"UpdatedDate":null}
--changesetresponse_27433a38-8952-42d8-b66b-fb7a27406c90--
--batchresponse_7aa4983b-fa44-4254-9013-897f986679ea--
and the response of the $batch call for an update. Notice that the data is not returned this time:
--batchresponse_5988bacc-ea77-43e8-8fe7-f18fe30ce710
Content-Type: multipart/mixed; boundary=changesetresponse_b5c2d17b-f7cd-42a2-a56c-e8fbbdade4ae
--changesetresponse_b5c2d17b-f7cd-42a2-a56c-e8fbbdade4ae
Content-Type: application/http
Content-Transfer-Encoding: binary
HTTP/1.1 204 No Content
Content-ID: 1
X-Content-Type-Options: nosniff
Cache-Control: no-cache
DataServiceVersion: 1.0;
--changesetresponse_b5c2d17b-f7cd-42a2-a56c-e8fbbdade4ae--
--batchresponse_5988bacc-ea77-43e8-8fe7-f18fe30ce710--