Restrict a generic type

Posted by Water Cooler v2 on Stack Overflow See other posts from Stack Overflow or by Water Cooler v2
Published on 2010-03-28T19:55:31Z Indexed on 2010/03/28 20:13 UTC
Read the original article Hit count: 95

Filed under:
|

I want to restrict the generic type parameter to:

1) either that of a certain user defined reference type;

OR

2) any of the primitive types in the CLR;

How do I say something to the effect of:

interface IDataManager<T>: IDataManager
    where T: IDataObject, T: ValueType

© Stack Overflow or respective owner

Related posts about generics

Related posts about c#