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

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

'T' in the generic type or method Questions published
Was this page helpful?
Yes Yes! this solution to the problem was helpful. No No! this solution to the problem was not helpful.. Leave ErnesTech Feedback.Feedback

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

Your Session is Ending
Login to Continue


© 2021 - ErnesTech - Privacy