[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.

Login to See the Rest of the Answer

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


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

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


© 2023 - ErnesTech LLC- Privacy