storing application-wide information

storing application-wide information

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


pillesoft posted on Wednesday, March 26, 2008

Dear All,

i'm new to c# using csla 3.0.3.
in my application i should store some information which is valid for the whole application.
e.g. user has to select a project after login. later all of the DB fetch should use this selected project as a kind of filter.
 
i saw in ProjectTracker app that ApplicationContext is used to store some values between client and server.
shall i use ApplicationContext for my example, or i'm totally on a wrong way.

thank you
Ivan

JoeFallon1 replied on Wednesday, March 26, 2008

Is this a Web or Windows app?

pillesoft replied on Wednesday, March 26, 2008

at the moment it is only a win app, but the structure is similar to the ProjectTracker solution.
so there is a library project, containing BOs, and a Win project containing the UI part of the system.
later if i will have Web app of course i will use the same BOs as in the Win app.

Ivan

skagen00 replied on Wednesday, March 26, 2008

We happen to have client ID as part of the login process to identify which client credential set the user should be authenticated against. This client ID is also important as it designates which database should be used for all data access. For us, the client ID was part of the user identification and is stored in our custom Identity object.

We use the data access piece of the enterprise library and hence whenever we get a Database object from the database factory we use a User class that exposes a DatabaseName based on the current user's client Id.

Long story short we carry this "additional information" in the identity - though your case may or may not parallel ours, where the client Id really is part of the identification of the current user.

 

pillesoft replied on Wednesday, March 26, 2008

as i saw i the PT app, and also in my case the authenticated user is also stored in the ApplicationContext.User property

i'm thinking to use ApplicationContext.LocalContext, or ApplicationContext.ClientContext, but i'm not sure which one?

Ivan

Copyright (c) Marimer LLC