C#C
C#3y ago
MuffinMan

✅ Is it possible to put a generic constraint on a record?

If I have a record Card<T> (....) and I want to put a constraint on it, such as where T : class? is there any way of doing this? The syntax does seem to be liked in my IDE (rider). All of the information I am trying to look up talks about the problem of making a constraint on T being a record, which is not even a thing.
Was this page helpful?