The type must be a reference type in order to use it as parameter ‘T’ in the generic type or method

I can’t repro, but I suspect that in your actual code there is a constraint somewhere that T : class – you need to propagate that to make the compiler happy, for example (hard to say for sure without a repro example):

public class Derived<SomeModel> : Base<SomeModel> where SomeModel : class, IModel
                                                                    ^^^^^
                                                                 see this bit

Leave a Comment