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
Post a Comment