IOC Question - is possible to resolve Object with some additional parameters?
See original GitHub issueHello, I have class which implement ITransistentDependeci inteface. This class have one constructor:
public class Test : ITransientDependency
{
public Test(string param, IOPManager manager)
{
}
}
IOPManager
is a DomainService with is registered in IOC, param
is some additional param
Is possible to resolve Test object from IOC with properly injected IOPManager manager
and manualy passed string param
?
Somethink like: var instance = IocManager.IocContainer.Resolve(testType, new { param = "test"});
Or exist some workaround when i need to have Constructor with custom parameters and use ABP Services / Managers in class ?
Thanks for help / tips !
Issue Analytics
- State:
- Created 7 years ago
- Comments:6 (4 by maintainers)
Top Results From Across the Web
c# - How to resolve instances with constructor parameters ...
I'm trying to build my own inversion of control container. Right now I store the objects with their types in a dictionary and...
Read more >IoC, Unity and passing parameters (or a way to avoid doing ...
When this happens it seems I'm no longer following an IoC pattern. The kicker here is that I cannot have the SPWeb object...
Read more >Understanding Dependency Injection in .NET Core
Resolution : this feature allows the IoC Container to resolve a dependency by creating an object and injecting it into the requesting class....
Read more >5. The IoC container
It is a process whereby objects define their dependencies, that is, the other objects they work with, only through constructor arguments, arguments to...
Read more >Blazor constructor injection. NET Core comes with thin but rich ...
NET Core comes with thin but rich and powerful built-in dependency injection mechanism we can use to inject instances to controllers and some...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This will work:
Do not forget to release manually resolved instances.
This works: