Class OptionalGenericParameter
A ParameterValue that lets you specify that an instance of a generic type parameter should be resolved, providing the null value if resolving fails.
Inherited Members
Namespace: Unity.Injection
Assembly: Unity.Abstractions.dll
Syntax
public class OptionalGenericParameter : GenericBase, IEquatable<Type>, IResolverFactory<Type>, IResolverFactory<ParameterInfo>
Constructors
| Improve this Doc View SourceOptionalGenericParameter(String)
Create a new GenericParameter instance that specifies that the given named generic parameter should be resolved.
Declaration
public OptionalGenericParameter(string genericParameterName)
Parameters
Type | Name | Description |
---|---|---|
String | genericParameterName | The generic parameter name to resolve. |
OptionalGenericParameter(String, String)
Create a new GenericParameter instance that specifies that the given named generic parameter should be resolved.
Declaration
public OptionalGenericParameter(string genericParameterName, string name)
Parameters
Type | Name | Description |
---|---|---|
String | genericParameterName | The generic parameter name to resolve. |
String | name | Registration name to use when looking up in the container. |
Methods
| Improve this Doc View SourceGetResolver<TContext>(Type, String)
Declaration
protected override ResolveDelegate<TContext> GetResolver<TContext>(Type type, string name)
where TContext : IResolveContext
Parameters
Type | Name | Description |
---|---|---|
Type | type | |
String | name |
Returns
Type | Description |
---|---|
ResolveDelegate<TContext> |
Type Parameters
Name | Description |
---|---|
TContext |