© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
9 replies
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.
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

✅ Is it possible to convert a generic interface to a generic interface?
C#CC# / help
3y ago
❔ Is it possible to put a method into a variable and call the variable?
C#CC# / help
4y ago
✅ Can i put constraint on ctor in interface
C#CC# / help
3y ago
❔ Is it possible to use a generic type as another type outside of the generic class w/o reflection?
C#CC# / help
3y ago