Method overloading in Unity container

0

I am registering my interface in App.config. But while resolving, I am getting the below exception.

Microsoft.Practices.Unity.ResolutionFailedException HResult=0x80131500 Message=Resolution of the dependency failed, type = "Philips.DI.Interfaces.UW.DtoModel.IModelProvider`1[Philips.DI.UW.PatientOrchestrator.Interfaces.PatientScheduleDataModel]", name = "LoginPage". Exception occurred while: while resolving.

Exception is: InvalidOperationException - The current type, Philips.DI.Interfaces.UW.DtoModel.IModelProvider`1[Philips.DI.UW.PatientOrchestrator.Interfaces.PatientScheduleDataModel], is an interface and cannot be constructed. Are you missing a type mapping?

At the time of the exception, the container was:

Resolving Philips.DI.Interfaces.UW.DtoModel.IModelProvider`1[Philips.DI.UW.PatientOrchestrator.Interfaces.PatientScheduleDataModel],LoginPage


        var proxy = container.Resolve<T>("LoginPage", new ResolverOverride[] {
           new ParameterOverride("unityContainer", container),new ParameterOverride("serviceEndPoint", serviceEndPoint)});





    public SyncProxy(IUnityContainer unityContainer, ServiceEndPoint serviceEndPoint) : base(unityContainer, serviceEndPoint)
    {
        _clientDataSyncWrapper = unityContainer.Resolve<ClientDataSyncWrapper>();
        RegisterPushMessages();
    }


    [InjectionConstructor]
    public SyncProxy(IUnityContainer unityContainer, string endPoint) : base(unityContainer, endPoint)
    {
        _clientDataSyncWrapper = unityContainer.Resolve<ClientDataSyncWrapper>();
        RegisterPushMessages();
    }
c#
asked on Stack Overflow Jun 25, 2019 by An Kumar • edited Jun 26, 2019 by An Kumar

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0