Beispiel #1
0
        public static Autofac.IContainer RegisterAsEasyNetQContainerFactory(this ContainerBuilder builder)
        {
            var autofacAdapter = new AutofacAdapter(builder);

            RabbitHutch.SetContainerFactory(() => autofacAdapter);

            return(autofacAdapter.Container);
        }
        public static Autofac.IContainer RegisterAsEasyNetQContainerFactory(this ContainerBuilder builder, Func <IBus> busCreator)
        {
            var adapter = new AutofacAdapter(builder);

            RabbitHutch.SetContainerFactory(() => adapter);

            var container = adapter.Container;

            var bus = busCreator();

            adapter.Register(provider => bus);

            return(container);
        }