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.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on July 17, 2025, 06:22