This feature is getting more and more demanded.
I'll give it a go, making it work without configuration business, and if one
wants to go further (such as configuring sessionfactory, I'll leave it to
anther tool such as FNH.

Victor's code will work for you, too.

Tuna Toksöz
Eternal sunshine of the open source mind.

http://devlicio.us/blogs/tuna_toksoz
http://tunatoksoz.com
http://twitter.com/tehlike




On Thu, Apr 30, 2009 at 2:20 AM, Yannis <[email protected]> wrote:

>
> Sorry I didnt write the way I meant to. I want to programmatically
> create an nhibernate facility.
>
> Currently I have a class that implements IConfigurationBuilder that as
> follows:
>
> public class NHibernateConfigurationBuilder : IConfigurationBuilder
>    {
>        #region IConfigurationBuilder Members
>
>        public Configuration GetConfiguration(IConfiguration config)
>        {
>            NHibernateConnectionParameters connectionParameters = new
> NHibernateConnectionParameters("test");
>            return connectionParameters.CreateNHibernateConfiguration
> ();
>        }
>
>        #endregion
>    }
>
>
> Then i am doing:
>
> NHibernateFacility nhibernateFacility = new NHibernateFacility(new
> NHibernateConfigurationBuilder());
> kernel.AddFacility("nhibernate", nhibernateFacility);
>
> but that results to an error: The NHibernateFacility requires an
> external configuration
> On Apr 29, 10:35 pm, Tuna Toksoz <[email protected]> wrote:
> > Adding NHFacility for injecting to a service constructor? why?
> >
> > Tuna Toksöz
> > Eternal sunshine of the open source mind.
> >
> >
> http://devlicio.us/blogs/tuna_toksozhttp://tunatoksoz.comhttp://twitter.com/tehlike
> >
> > On Thu, Apr 30, 2009 at 12:32 AM, Yannis <[email protected]>
> wrote:
> >
> > > is there any way to add an nhibernate facility programmatically and
> > > associate it with a service constructor?
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Castle Project Users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/castle-project-users?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to