I am developing a WCF data service with self-monitoring objects, and I want clients not to insert duplicate content. Whenever they are POST data without providing a value for the data key, I have to follow some logic to determine if that data is already in my database or not. I wrote the Change interceptor as follows:
[ChangeInterceptor("MyEntity")] public void OnChangeEntity(MyEntity item, UpdateOperations operations){ if (operations == UpdateOperations.Add) {
However, this does not work. The existing EntityID is ignored and, as a result, the record is always inserted, never updated. Can this be done? Thanks in advance.
source share