Click here to Skip to main content
15,896,153 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
i have mvc api in which in am using Microsoft.Practices.Unity as DI. Below is how my code is.

Controller
C#
public class ZoneController : BaseApiController
{
        private IZoneManager CurrentZoneManager;
        
        public ZoneController(IZoneManager zoneManager)
        {
            if (zoneManager == null)
            {
                throw new ArgumentNullException("Manager");
            }
            CurrentZoneManager = zoneManager;
        }
}



Manager
C#
public class UnitTypeManager : IUnitTypeManager
    {
        static IUnitTypeProvider CurrentUnitTypeProvider;

        public UnitTypeManager(IUnitTypeProvider unitTypeProvider)
        {
            if (unitTypeProvider == null)
            {
                throw new ArgumentNullException("provider");
            }
            CurrentUnitTypeProvider = unitTypeProvider;
        }
}


Provider
C#
public class ZoneProvider : IZoneProvider
    {
        private MobileContext _context;

        public ZoneProvider()
        {
            _context = new MobileContext ();
        }
}



Now this is how i am Registering
C#
public static void RegisterTypes(IUnityContainer container)
        {
          container.RegisterType();
            container.RegisterType(
                new HierarchicalLifetimeManager());
            container.RegisterType(
             new HierarchicalLifetimeManager());
        }



Now i am getting the error "There is no implicit conversion from ZoneTypeManager to IZoneTypeManager"

Can i now have i missed anything
Posted
Updated 25-Feb-15 22:25pm
v2
Comments
Richard MacCutchan 26-Feb-15 6:06am    
I do not see any reference to either ZoneTypeManager or IZoneTypeManager. Where do these errors occur?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900