TypesExtensionsToFriendlyName Method

Simple Injector
Builds an easy to read type name. Namespaces will be omitted, and generic types will be displayed in a C#-like syntax. Ideal for reporting type names in exception messages.

Namespace:  SimpleInjector
Assembly:  SimpleInjector (in SimpleInjector.dll) Version: 5.3.0

public static string ToFriendlyName(
	this Type type


Type: SystemType
The type to convert.

Return Value

Type: String
A human-readable string representation of that type.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type Type. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).

ArgumentNullExceptionThrown when the supplied argument is a null reference.
See Also