StructureMap自动注册未引用的泛型类型

时间:2013-11-11 19:09:05

标签: c# structuremap auto-registration

我收到此错误:No Default Instance defined for PluginFamily IReadModelRepository

这是我的注册表

    public class DependencyRegistry : Registry
    {
        public DependencyRegistry()
        {
            //Must reference ReadModelRepository dll or get the above error
            //For(typeof(IReadModelRepository<>)).Use(typeof(ReadModelRepository<>));

            Scan(x =>
            {
                x.AssembliesFromApplicationBaseDirectory();
                x.WithDefaultConventions();
            });
        }
    }

有没有办法让上面的注册表工作而没有明确引用ReadModelRepository

0 个答案:

没有答案