Hi All,
I am using CSLA to build an application.My database table has a column createdBy and I need to get the logged in user in the Business Object.I dont want the user to set it rather I want the BO to read for the current context.
Here is the code I have in the web app membership provider
public override bool ValidateUser( string username, string password){
bool result = PEPrincipal.Login(username, password); HttpContext.Current.Session["CslaPrincipal"] = Csla.ApplicationContext.User;//Csla.
ApplicationContext.ClientContext.Add("user_id", 123); return result;}
How do I access this in the BO ?
I tried teh following but its giving me an invalid cast exception
//PEPrincipal _principal; //_principal = (PEPrincipal)Csla.ApplicationContext.User; //PEIdentity _identity = (PEIdentity)_principal.Identity; Any suggestions ?Also can anyonw suggest me how to use the ClientContext ?
--bnair
Copyright (c) Marimer LLC