Question: I have configured a `NamedOption` in `ConfigureServices` method of `Startup.cs` like following:

```
services.Configure<MyOpts>("myOpts", 
   opts => configuration.Bind("myOpts", opts));

```

I have a controller action in `asp.net core` api like following:

```
public async Task<IActionResult> Insert(CreateUserCommand command)
{
    var id = await Mediator.Send(command);

    return Ok(id);
}

```

This is my `CreateUserCommand`:

```
public class CreateUserCommand
{
    private MyOpts opts { get; }

    public CreateUserCommand(IOptionsSnapshot<MyOpts> opts)
    {
        this.opts = opts.Get("myOpts");
    }

    public long UserId { get; set; }
    public string Username { get; set; }
    public string FirstName { get; set; }
}

```

When client hits my api, I want `MyOpts` object injected in `CreateUserCommand(IOptionsSnapshot<MyOpts> opts)`. CreateUserCommand is in the assembly other than asp.net core project. Is it possible to achieve this behaviour?

Answer: 
If you register also Commands in DI then yes (You usually don't register commands with DI), but based what I see CreateUserCommand is a payload (in your case) so I assume that you don't register it and it will not work (not only in a different assemblies but also in same assemblies).
Because you use Mediator I assume that you have a handler for CreateUserCommand and I think there you can inject your configuration and it will work.
Yes, the Default ASP.NET Core DI supports the Injection across the multiple assemblies when done right.

Please refer the nice article for more details.

<https://asp.net-hacker.rocks/2017/03/06/using-dependency-injection-in-multiple-projects.html>

Hope this helps!