Beispiel #1
0
        public void Build()
        {
            var builder = new ContainerBuilder();

            var assemblies = new List <Assembly>();

            var finder = new TypeFinder();

            foreach (var subscriber in finder.FindTypesOf <ISubscriber>(assemblies))
            {
                builder.RegisterType(subscriber).AsSelf();
            }

            var dependenciesFactory = new DependenciesFactory();
            var dependencies        = dependenciesFactory.Create(assemblies);

            foreach (var dependency in dependencies)
            {
                dependency.Add(builder);
            }

            var container = builder.Build();

            var subscribers = container.Resolve <IEnumerable <ISubscriber> >();

            var processor = new Processor(subscribers, _documentStore);
        }
Beispiel #2
0
        public IEnumerable <IDependencies> Create(IEnumerable <Assembly> assemblies)
        {
            var finder = new TypeFinder();

            return(finder.FindTypesOf <IDependencies>(assemblies).Select(c => Create(c.AsType())));
        }