Quantcast
Channel: patterns & practices: Prism
Viewing all articles
Browse latest Browse all 1878

New Post: Access currently logged in User

$
0
0

Hi,

In my opinion, a possible approach to handle this scenario could be using Shared Services to access and manage information among different modules (in this case, the logged user).

Basically, you could create a service that could store the current user, implementing an interface. Then, you could register this service in the container as asingleton mapped to that interface and import it in the modules through it. This interface could be declared in a common assembly referenced by all the modules (like an "Infrastructure" project,) while the service implementation itself could be declared in a module or in the shell project. Like this, you wouldn't need to have a reference to the project where the service is implemented, as the modules only need to know the corresponding interface.

You can find more information about Shared Services in the following section of the documentation:

Also, you can find more information about how to register a singleton in the container in the following chapter:

Damian Cherubini
http://blogs.southworks.net/dcherubini


Viewing all articles
Browse latest Browse all 1878

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>