Customizing BusinessIdentity

Customizing BusinessIdentity

Old forum URL: forums.lhotka.net/forums/t/146.aspx


Aliator posted on Thursday, May 18, 2006

Hi,

I'm developping a website, and I want to extend my BusinessIdentity class, adding 2 properties: email and userId (as Guid). I want this because some Objects need to know what user created them, so I would like to be able to have this:

Guid _userID = Csla.ApplicationContext.User.UserID;

I implemented code in my BusinessIdentity class to have a public property UserID, but I can't access it when I write Csla.ApplicationContext.User.

Can I do it with out touching CSLA framework ?

Thank you

BTW: CSLA ROCKS !!!

razorkai replied on Thursday, May 18, 2006

Hi

User is of type IPrincipal so you have to do the following

((MyIdentityClass)Csla.ApplicationContext.User.Identity).UserID;

HTH

P.S. Code written very late so apologies if incorrect

John.

Aliator replied on Friday, May 19, 2006

It works like a charm... Thank you.

Copyright (c) Marimer LLC