Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

Problems with Dependency Injection over MVC

$
0
0

Hello guys,

I'm trying to implement the Dependency Injection from Core on my software in order to replace Ninject and update everything to our new technology.

Btw, I'm facing a problem on some interfaces that are generic. For such cases I'm getting directly an Exception that the injector could not create an instance of my class.

I inserted above a small snippet of a sample case that puts me on fire.

services.AddTransient(typeof(IRepository), typeof(MyRepository<,>))

Is that way correct? How can I do that?

Thanks!


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>