I've solved it using:

configuration = Fluently.Configure(configuration)
                                                .Mappings(c =>
                                                          {
                                                              foreach (var
assembly in Mappings)

c.FluentMappings.AddFromAssembly(assembly);
                                                          })
                                                .ExposeConfiguration(x => {

 x.SetProperty(Environment.CurrentSessionContextClass, isWeb ? "web" :
"thread_static");

 x.SetProperty(Environment.ConnectionString, customConnectionString);
                                                })
                                                .BuildConfiguration();


On Tue, Dec 1, 2015 at 2:59 PM, Felipe Oriani <felipeori...@gmail.com>
wrote:

> Hi All,
>
> I have a hibrid session factory configuration using hibernate.cfg.xml and
> Fluent NHibernate. My code looks like this:
>
> -----
>
> // load configuration from hibernate.cfg.xml -- the provider what we are
> using is here!
> configuration = new Configuration().Configure();
>
> // add extra functions and load the mappings with FluentNH!
> configuration = Fluently.Configure(configuration)
>                                                 .Mappings(c =>
>                                                           {
>                                                               foreach (var
> assembly in Mappings)
>
> c.FluentMappings.AddFromAssembly(assembly);
>                                                           })
>                                                 .ExposeConfiguration(x =>
> x.SetProperty(Environment.CurrentSessionContextClass, isWeb ? "web" :
> "thread_static"))
>                                                 .BuildConfiguration();
>
>
> -----
>
> I have a string which is my connectionString and it can be changed by the
> customer and the environment of execution. I would like to know how can I
> set the connectionstring without fixing a provider in Fluently.DataBase()
> method?
>
> Thank you.
>
>
> --
> ______________________________________
> Felipe B Oriani
> felipeori...@gmail.com
>



-- 
______________________________________
Felipe B Oriani
felipeori...@gmail.com

-- 
You received this message because you are subscribed to the Google Groups 
"Fluent NHibernate" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to fluent-nhibernate+unsubscr...@googlegroups.com.
To post to this group, send email to fluent-nhibernate@googlegroups.com.
Visit this group at http://groups.google.com/group/fluent-nhibernate.
For more options, visit https://groups.google.com/d/optout.

Reply via email to