Ejemplo n.º 1
0
        protected override void ConfigureContainer()
        {
            base.ConfigureContainer();

            Container.Configure(cfg => {
                cfg.For <IEmailService>().Use <SmtpEmailService>();
                cfg.For <ISessionFactory>().Singleton().Use(() => NHibernateConfiguration.Factory());
                cfg.For <IMessageModule>().Singleton().Use <NHibernateMessageModule>();
                cfg.For <INHibernateSessionProvider>().Use <NHibernateMessageModule>();
                cfg.For <ISession>().Use(ctx => ctx.GetInstance <INHibernateSessionProvider>().CurrentSession);
                //cfg.For(typeof(ISagaPersister<>)).Singleton().Use(typeof(InMemorySagaPersister<>));
                cfg.For(typeof(ISagaPersister <>)).Use(typeof(NHibernateSagaPersister <>));
            });
        }