I assume MembershipUser object and object implementing IPrincipal interface are “connected” in a sense that when certain information in one of the objects changes, the other object is also changed appropriately?
Not sure whether or not I understand your question here but I believe your assumption is incorrect.
MembershipUser is used by System.Web.Security to authenticate a User via the MembershipProvider to you have set in you web config. When you call...
MembershipUser user = Membership.GetUser(username);
Your membership provider will query the datastore where you keep your user information (A Sql Database, Active Directory, etc..) and return back the Memberhsip data sotred for that username.
If you have defined another class in your application that implements the IPrincipal interface and you have instantiated an object of that type, that does not necessarily mean that your MembershipUser object and your custom object share data (unless of course you have assigned the reference programatically )
Maybe if you provided a code example it would help clarify
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With