“XX”类型无法分配给服务

时间:2017-07-10 04:00:37

标签: autofac

现在我在注册通用组件时出现问题,这是我的错误消息:

enter image description here

这是我的代码:

namespace ProjectFrameworkRepository.InventoryRepository
{
    public class InventoryAgentRepository :EntityRepository<InventoryAgent,ProjectDataContext>, IInventoryAgentRepository
    {
        public InventoryAgentRepository(IServiceLocator serviceLocator) : base(serviceLocator)
        {
        }
    }
}

#region 注册服务Repository
builder.RegisterType<InventoryAgentRepository>().As<IInventoryAgentRepository>().SingleInstance();

#region 注册服务接口
builder.RegisterType<InventoryAgentService>().As<IInventoryAgentService>().SingleInstance();

0 个答案:

没有答案