Resolver dependency on Unity
I need to resolve a dependency in Unity – but have no ideia on how.
This is the register
container.RegisterType<IStuff<IInput, IIouput>, GetStuff>("tService", new ContainerControlledLifetimeManager());
On Unity
public static IUnityContainer RegisterType<TFrom, TTo>(this IUnityContainer container, string name, ITypeLifetimeManager lifetimeManager, params InjectionMember[] injectionMembers) where TTo : TFrom;
How can i resolve this when i need? Because i’m not able to get a type for IStuff<IInput, IIouput>, GetStuff
And the resolver method implies that I had the type
<Extension> Public Shared Function Resolve(Of T)(container As IUnityContainer, ParamArray [overrides]() As ResolverOverride) As T <Extension> Public Shared Function Resolve(Of T)(container As IUnityContainer, name As String, ParamArray [overrides]() As ResolverOverride) As T <Extension> Public Shared Function Resolve(container As IUnityContainer, t As Type, ParamArray [overrides]() As ResolverOverride) As Object
When I try to get the type:
Dim t = GetType(IStuff< IInput, IIouput>)
Severity Code Description Project File Line Suppression State Error BC32042 Too few type arguments to ‘IStuff(Of TRequest As IBaseIn, TResponse As IBaseOut)’.