[AspNet 6] Using Generic Types in an Interface MVC C-Sharp

Question: How do you inject an Interface with a generic Type defined? When try to inject the Interface in Dependency Injection (ctor) I am getting an error that says, CS0452: The type 'T' must be a reference type in order to use it as parameter 'T' in the generic type or method.


Please Login to see the rest of the answer

Answer: Do you know someone who can answer this question?


Write an Article
If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.


© 2022 - ErnesTech - Privacy