[fluent-nhib] Re: Can I get the nh's Configuration instance from FluentConfiguration?

2009-02-18 Thread James Gregory
Thanks Karron, I'd never thought of that situation. I've applied your patch, good work! On Wed, Feb 18, 2009 at 3:09 AM, Karron Qiu wrote: > Here is my patch for ExposeConfiguration, please have a look. > > On Wed, Feb 18, 2009 at 10:12 AM, Karron Qiu wrote: > > Sorry for my bad English, that c

[fluent-nhib] Re: Can I get the nh's Configuration instance from FluentConfiguration?

2009-02-17 Thread Karron Qiu
Here is my patch for ExposeConfiguration, please have a look. On Wed, Feb 18, 2009 at 10:12 AM, Karron Qiu wrote: > Sorry for my bad English, that confused you. > > I have two reasons here. > > 1. ExposeConfiguration method can't be called many times. It's an > delegate , not a list that contains

[fluent-nhib] Re: Can I get the nh's Configuration instance from FluentConfiguration?

2009-02-17 Thread Karron Qiu
Sorry for my bad English, that confused you. I have two reasons here. 1. ExposeConfiguration method can't be called many times. It's an delegate , not a list that contains delegates. If I call this method many times, only the last one will be executed. Because I have some plugins for nh initiali

[fluent-nhib] Re: Can I get the nh's Configuration instance from FluentConfiguration?

2009-02-17 Thread Paul Batum
Ribbit! Ribbit! On Wed, Feb 18, 2009 at 1:16 AM, James Gregory wrote: > Right, the constructor change is in. You can now do this: > var cfg = new Configuration(); > > Fluently.Configure(cfg) > .blah(); > > > On Tue, Feb 17, 2009 at 12:00 PM, James Gregory > wrote: > >> Calm it Kermit. I'm not

[fluent-nhib] Re: Can I get the nh's Configuration instance from FluentConfiguration?

2009-02-17 Thread James Gregory
Right, the constructor change is in. You can now do this: var cfg = new Configuration(); Fluently.Configure(cfg) .blah(); On Tue, Feb 17, 2009 at 12:00 PM, James Gregory wrote: > Calm it Kermit. I'm not against having a constructor overload, I'll do > that next time I'm in there. > > As for e

[fluent-nhib] Re: Can I get the nh's Configuration instance from FluentConfiguration?

2009-02-17 Thread James Gregory
Calm it Kermit. I'm not against having a constructor overload, I'll do that next time I'm in there. As for exposing the property, I'd prefer not to because it's polluting the API, but I'm not that fussed. All I wanted to know was why he said he couldn't use the ExposeConfiguration; not didn't wan

[fluent-nhib] Re: Can I get the nh's Configuration instance from FluentConfiguration?

2009-02-17 Thread Paul Batum
Just wanted to add that I recognise you can get a reference to it using Tuna's trick with the closure but I think its highly unintuitive. On Tue, Feb 17, 2009 at 9:34 PM, Paul Batum wrote: > James, is there a reason you don't want to expose the Configuration? What > if someone wants to do someth

[fluent-nhib] Re: Can I get the nh's Configuration instance from FluentConfiguration?

2009-02-17 Thread Paul Batum
James, is there a reason you don't want to expose the Configuration? What if someone wants to do something with it after the session factory is built? It seems perfectly reasonable to me for the getter to be public. Also, I wanted to add an overload to Fluently.Configure that takes an existing Con

[fluent-nhib] Re: Can I get the nh's Configuration instance from FluentConfiguration?

2009-02-17 Thread James Gregory
Why can't you use the ExposeConfiguration method? Some explanation would help. On Tue, Feb 17, 2009 at 7:33 AM, Karron Qiu wrote: > > Thank you. > > On Tue, Feb 17, 2009 at 3:28 PM, Tuna Toksoz wrote: > > Configuration cfg; > > var fconfig=Fluently.Configure().ExposeConf

[fluent-nhib] Re: Can I get the nh's Configuration instance from FluentConfiguration?

2009-02-16 Thread Karron Qiu
Thank you. On Tue, Feb 17, 2009 at 3:28 PM, Tuna Toksoz wrote: > Configuration cfg; > var fconfig=Fluently.Configure().ExposeConfiguration(x => cfg = > x); > PlayWithCfgHere > var sf = fconfig.BuildSessionFactory(); > > > Or simple call ExposeConfi

[fluent-nhib] Re: Can I get the nh's Configuration instance from FluentConfiguration?

2009-02-16 Thread Tuna Toksoz
Configuration cfg; var fconfig=Fluently.Configure().ExposeConfiguration(x => cfg = x); PlayWithCfgHere var sf = fconfig.BuildSessionFactory(); Or simple call ExposeConfiguration(Action) to modify/dowhatever using a delegate. Tuna Toksöz http://tuna

[fluent-nhib] Re: Can I get the nh's Configuration instance from FluentConfiguration?

2009-02-16 Thread Karron Qiu
I just want to get the Configuration object from Fluently.Configure(). Or can I pass a Configuration object to Fluently.Configure() ? Thanks On Tue, Feb 17, 2009 at 3:15 PM, Tuna Toksoz wrote: > Fluently.Configure() > .Database(/* your database settings */) > .Mappings(/* your mappings */)

[fluent-nhib] Re: Can I get the nh's Configuration instance from FluentConfiguration?

2009-02-16 Thread Tuna Toksoz
1. Fluently.Configure() 2. .Database(/* your database settings */) 3. .Mappings(/* your mappings */) 4. .ExposeConfiguration(/* alter Configuration */) // optional 5. .BuildSessionFactory(); says the post on James blog? Tuna Toksöz http://tunatoksoz.com http://turkiyealt.ne