Class ConvertTypeNameType
- Namespace
- SunamoConverters.Converts
- Assembly
- SunamoConverters.dll
Converts between type name strings and System.Type objects for all supported basic types.
public class ConvertTypeNameType
- Inheritance
-
ConvertTypeNameType
- Inherited Members
- Extension Methods
Methods
ToType(string)
Converts a type name string to a System.Type. Throws an exception if the type is not supported. If comparing the obtained type, use typeof(int, string, byte) not typeof(Int32, String, Byte). The input string must be without "System." prefix.
public static Type ToType(string typeName)
Parameters
typeNamestringThe type name to convert (e.g., "string", "int", "Int32").
Returns
- Type
The corresponding System.Type.
Exceptions
- Exception
Thrown when the type name is not supported.