WCF数据服务和ChangeInterceptor
我想查看并修改通过changeInterceptor 内的PUT 动词提交的信息。
例如,我可能想在更新数据源之前清除传入的所有值。
或者,也许我可以通过 java 脚本调用数据服务,而不是传入对象上的所有当前属性,而是完整服务器上的值。
苏...
OnChangeMyObject<MyObject,Update...>{
if(UpdateOperations == UpdateOperations.change){
MyObject == the object to be updated but not the object passed in from the
caller. How can I access the object from the caller?
}
}
I would like to look at and modify the information submitted via the PUT verb inside a changeInterceptor.
For instance I might want to scrub all values passed in before updating my dataSource.
Or maybe I could call a Data Service via java script and not pass in all the current properties on the object rather complete there values on the server.
Soo...
OnChangeMyObject<MyObject,Update...>{
if(UpdateOperations == UpdateOperations.change){
MyObject == the object to be updated but not the object passed in from the
caller. How can I access the object from the caller?
}
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为您可以在更改拦截器中执行类似的操作:
ValidatePutData 方法检查更改的对象数据。当 EF 保存您的更改时将调用该方法。此时,实体对象的实例包含通过 PUT 请求传输的新数据。
I think you could do something like this in your change interceptor:
Where the method ValidatePutData checks the changed object data. The method will be called when the EF saves your changes. At that point in time the instance of entity object contains the new data which was transmitted with the PUT reqest.