Get UserId from class library project
问题 Is there a way to get the UserId from a class library project? This class library project logs everything a user does and write it to a database. But I need the UserId too which I can't get from any project except a web project. I also would need the user's ip address from the class library project. Anyone has done this before in an asp.net-mvc project and could share it how to do it? 回答1: I had a similar situation in my current project, the way I did it was to pass the UserID as a parameter