When I constrain T with : Object like this:
public interface IDoWork where T : Object { T DoWork(); }
I get the error:
If you want to constrain a generic type to be a reference type, use : class.
: class
public interface IDoWork where T : class { T DoWork(); }
This will forbid the generic type from being a value type, such as int or a struct.
int