views:

133

answers:

3

I need to provide a user a list of all primitive types available and was wondering if there is an Enum in the .net library that has all primitive types, so that I don't have to build one.

+5  A: 

No, there is no such enum.

Maximilian Mayerl
+2  A: 

The nearest you are going to get is System.TypeCode.

Martin Brown
This will suffice. Thanks bunch
epitka
+5  A: 

Not an enum, but:

var primitives = typeof(int).Assembly.GetTypes()
       .Where(type => type.IsPrimitive).ToArray();
Marc Gravell