Class TypeExtensions
Inheritance
Namespace: DotNetNuke.DependencyInjection.Extensions
Assembly: DotNetNuke.DependencyInjection.dll
Syntax
public static class TypeExtensions : object
Methods
| Improve this Doc View SourceBuildLoaderExceptionsMessage(IReadOnlyDictionary<Assembly, ReflectionTypeLoadException>)
Builds a message to load for a collection of
Declaration
public static StringBuilder BuildLoaderExceptionsMessage(this IReadOnlyDictionary<Assembly, ReflectionTypeLoadException> loadExceptions)
Parameters
| Type | Name | Description |
|---|---|---|
| IReadOnlyDictionary<Assembly, ReflectionTypeLoadException> | loadExceptions | A dictionary mapping |
Returns
| Type | Description |
|---|---|
| StringBuilder | A |
LogOtherExceptions(TypesResult, ILog)
Logs the exceptions in OtherExceptions of result using logger.
Declaration
public static void LogOtherExceptions(this TypesResult result, ILog logger)
Parameters
| Type | Name | Description |
|---|---|---|
| TypesResult | result | The types result to log. |
| ILog | logger | The logger. |
SafeGetTypes()
Safely get all types from all assemblies.
Declaration
public static TypesResult SafeGetTypes()
Returns
| Type | Description |
|---|---|
| TypesResult | A sequence of all available |
SafeGetTypes(Assembly, ILog)
Safely Get all Types from the assembly. If there is an error while retrieving the types it will return an empty array of
Declaration
public static Type[] SafeGetTypes(this Assembly assembly, ILog logger)
Parameters
| Type | Name | Description |
|---|---|---|
| Assembly | assembly | The assembly to retrieve all types from. |
| ILog | logger | A optional ILog object. This will log issues loading the types. |
Returns
| Type | Description |
|---|---|
| Type[] | An array of all |
SafeGetTypes(Assembly)
Safely Get all Types from the assembly. If there is an error while retrieving the types it will return an empty array of
Declaration
public static Type[] SafeGetTypes(this Assembly assembly)
Parameters
| Type | Name | Description |
|---|---|---|
| Assembly | assembly | The assembly to retrieve all types from. |
Returns
| Type | Description |
|---|---|
| Type[] | An array of all |
Remarks
This is obsolete because logging is not added. Please use the SafeGetTypes with the ILog parameter.
SafeGetTypes(IEnumerable<Assembly>)
Safely get all types from a set of assemblies.
Declaration
public static TypesResult SafeGetTypes(this IEnumerable<Assembly> assemblies)
Parameters
| Type | Name | Description |
|---|---|---|
| IEnumerable<Assembly> | assemblies | The assemblies. |
Returns
| Type | Description |
|---|---|
| TypesResult | A sequence of all available |