Method overloading based on generic constraints?
This is not possible.
Generic constraints are not considered to be part of the method signature for purposes of overloading.
If you want to allow both value types and reference types, why constrain at all?
Can I somehow have overloaded methods which differ only by generic type constraints?
No. It's not part of the method signature in terms of overloading, just like the return type isn't.
There are horrible ways of "pseudo-overloading" in some cases, but I wouldn't recommend going down that path.
For more information, you might want to read:
- My blog post on the topic
- Eric Lippert's blog post on the topic