I need to implement AddedBy/ChangedBy type fields on my Base Entity that all other entities inherit from ( Fluent Nhibernate ).
Accessing HttpContext.User.Identity
I have used a factory to get the correct repo with or without a "CurrentUser" since sometimes you need to know who the user is and sometimes you don't.
//I have a current user that I got from the Identity
var repo = RepoFactory.GetRepo(currentUserId);
//I don't have a current user
var repo = RepoFactory.GetRepo()
This way you can pull the Identity from the HttpContext and pass only details you need to the repo.