Open Closed

How to get object from DI (not via constructor) #2571


User avatar
0
Jurjen created

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v5.1.3
  • UI type: Blazor
  • DB provider: EF Core
  • Exception message and stack trace: n/a
  • Steps to reproduce the issue: n/a

We'd like to be able to, on the fly, retrieve an object from DI/IOC. In our situation it's not possible to do this through injection in the class constructor.

With ASP.NET Zero we could use IocManager.Resolve<type>

Is something similar possible with ABP.IO

kind regards, Jurjen.


2 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    See https://docs.abp.io/en/abp/latest/Dependency-Injection#property-injection

  • User Avatar
    0
    Jurjen created

    thank you. I'll look into that.

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11