Using a client config value from within the DataPortal

Using a client config value from within the DataPortal

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


stefan posted on Monday, September 03, 2007

I am currently building a custom authorization mechanism.
I want my security db to provide for more than one application.
(Maybe my webclient is requiring a differnt set of roles...)

Therefore I have to pass  the "Application Name"-string value, which is read from the
client config file, to the DataPortal, which might be an app-server.

I don't want to read from the config file each time I need the ApplicationName value.

Is it a good idea to store that value once inside ApplicationContext.ClientContext,
and from then on, retrieve it from there?

Any objections?

Stefan

RockfordLhotka replied on Tuesday, September 04, 2007

Remember that .NET caches the config file values, so "re-reading" the value is actually not a big deal (though it is a dictionary lookup after the first call).

But ClientContext may not be ideal because that flows across from client to server on every data portal call. That'd be more expensive than doing a dictionary lookup Smile [:)]

It sounds like you only need the app name for the login process, not on every data portal call. So it seems to me that getting the value from config and passing it in your identity object's criteria would be most efficient.

Copyright (c) Marimer LLC