I would like to limit the data types my method accepts using generics to built in types:
Built in types: http://msdn.microsoft.com/en-us/library/ya5y69ds(v=vs.80).aspx
The list differs from value / reference types. And I would like to only support built in, not all value types, and ofc also string, which is a reference type.
Is this possible?
EDIT:
Using constraints you can restrict to value types like this:
T GetObject<T> where T: struct;
This would not permit strings to pass through though.