Injecting generic services

0
0

Using microsoft’s DI we are able to inject a generic service as follows:
builder.Services.AddScoped(typeof(DBConnection<>));

this allows us to inject any DBConnection<T> without actually registering a DBConnection<T> for each T.

 

unfortunately I can’t find how to do it using wisej DI.

 

Any advise?

Best regards,

Ali

  • You must to post comments
0
0

Hi Ali,

did you check out our documentation at

https://docs.wisej.com/docs/concepts/dependency-injection

Best regards
Frank

  • Ali Badran
    Yes, I’m following the documentation, I didn’t find any option to inject a generic service as I mentioned in my question. As a workaround I’m currently using MS DI.
  • Luca (ITG)
    Correct. It’s not supported but you can use any .NET container. If you like the MS one that’s a good solution.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.