Not Monitored
Tag not monitored by Microsoft.
35,932 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
I am using Unity to do our Dependency Injection
I would like to inject the users id into the constructor
Here is my setup:
private readonly IImportRespository repo;
private readonly IUserService userService;
/// <summary>
/// Initializes a new instance of the </summary>The repo.
/// The user service.
/// The user request user identifier.
public ImportService(IImportRespository repo, IUserService userService, int userRequestUserId)
{
this.repo = repo;
this.userService = userService;
UserRequestingId = userRequestUserId;
}
Here is how I'm registering in my global.asax file:
public class ImportDIRegistration
{
/// <summary>
/// Imports the di registration types.
/// </summary>
///
Might try asking for help over here.
https://stackoverflow.com/questions/tagged/unity3d+unity-container
--please don't forget to upvote
and Accept as answer
if the reply is helpful--