开发者

How can i prevent RIA service change tracking for certain fields?

How can i prevent RIA service change tracking on certain properties. I have a partial class and i want that RIA service should not tra开发者_Python百科ck changes to it. How can i do that?

Currently if i see in generated code, i can methods like OnXXXChanging() nad OnXXXChanged() etc etc. I want these should not be generated for my custom properties.

Thanks in advance :)


To stop RIA Services tracking (or even generating) a property, just add the [Exclude] attribute to the property (either in the .shared.cs or in a metadata class.

If you then add a [DataMember] attribute, WCF will still serialize/deserialize it, but RIA Services won't care about it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜