This project is read-only.

Type Extension Methods

The following extension methods are defined for the Type type:

  • bool IsNullableValueType().
    Determines whether the type specified is a Nullable<T> type (true) or not (false).
  • string GetFullTypeName().
    Gets the full type name, of the format: Type.Fullname, assembly name. If the assembly is signed, the full assembly name is added, otherwise just the assembly name, not the version, public key token or culture. Use this method if you need to store the type's full name in a string for re-instantiation later on with Activator.CreateInstance and you also don't want to store long strings for system types like System.String which can be re-instantiated without the string name signature of the assembly.
  • bool IsNetSystemType().
    Determines whether the type specified is a system type of .NET. System types are types in mscorlib, assemblies which start with 'Microsoft.', 'System.' or the System assembly itself. It sees Microsoft.SqlServer.Types as an exception and doesn't qualify these types as system types. The method is not 100% reliable for Microsoft originating types which are in a Microsoft.* namespace but not shipped with .NET.
  • bool GetDefaultValue(bool safeDefaults).
    Gets the default value for the type, e.g. 0 for int, the empty Guid for Guid. It returns string.Empty for string, empty byte array for a byte array, if safeDefaults is set to true.

Last edited Nov 27, 2010 at 1:30 PM by SolutionsDesign, version 2

Comments

No comments yet.