New Posts New Posts RSS Feed: Custom IPrincipal/IIdentity?
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Custom IPrincipal/IIdentity?

 Post Reply Post Reply
Author
ahopper View Drop Down
Newbie
Newbie
Avatar

Joined: 18-Mar-2010
Location: Atlanta, GA
Posts: 8
Post Options Post Options   Quote ahopper Quote  Post ReplyReply Direct Link To This Post Topic: Custom IPrincipal/IIdentity?
    Posted: 07-Apr-2010 at 8:03am
We are using DevForce 9 with Silverlight clients, and we'd like some custom data to travel with the user information; however, when we try to create a LoginManager that returns our custom principal, we're getting what appear to be serialization errors griping about the datacontract serializer not being aware of the type. Unfortunately, I have no way to add that attribute to whatever class is being serialized as it is inside the compiled DevForce assemblies. Is there a way to make the serializer aware of our types?
Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Posted: 07-Apr-2010 at 5:21pm
On your custom class did you do the following?:
  1. Mark your class with the [DataContract] attribute.
  2. Mark your class with the [DiscoverableType(DiscoverableTypeMode.KnownType)] attribute OR have your class implement IKnownType (a marker interface).
  3. Have each serializable property in the class marked with the [DataMember] attribute.


Edited by ting - 07-Apr-2010 at 5:23pm
Back to Top
ahopper View Drop Down
Newbie
Newbie
Avatar

Joined: 18-Mar-2010
Location: Atlanta, GA
Posts: 8
Post Options Post Options   Quote ahopper Quote  Post ReplyReply Direct Link To This Post Posted: 08-Apr-2010 at 2:39pm
Ah, that did the trick. Many thanks.
Back to Top
ting View Drop Down
IdeaBlade
IdeaBlade
Avatar

Joined: 27-Mar-2009
Location: San Francisco
Posts: 427
Post Options Post Options   Quote ting Quote  Post ReplyReply Direct Link To This Post Posted: 09-Apr-2010 at 3:34pm
Cool!  Glad I could help.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down