开发者

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

开发者 https://www.devze.com 2023-02-23 12:21 出处:网络
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?

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

精彩评论

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