c# - DataMember attribute on private members - Whats happening under the hood -


[datacontract] public class myclass {     [datamember]     private string privatefiled;      // other properties elided.     ... } 

how privatefiled getting set datacontractserializer when serialized/deserialized, how able access private variable. happening under hood? concepts behind this. please point sources on this.

you can access non-public members via .net reflection api. reason, although public/private/internal modifiers imply sort of security, should thought of organizational in nature, since circumvented reflection.


Comments

Popular posts from this blog

How to logout from a login page in asp.net -

Stack level too deep error after upgrade to rails 3.2 and ruby 1.9.3 -