i try to integrate Castle Windsor and Nhibernate Facility with my legacy old project recently, follow the doc(http://docs.castleproject.org/Windsor.NHibernate-Facility.ashx).
<facilities>
<facility id="nhibernate" ...>
<factory id="nhibernate.factory">
...
</factory>
<factory id="nhibernate.factory" alias="oracle2">
...
</factory>
</facility>
</facilities>
but i wonder if there is an way to configure the NHibernate SessionFactory by C# code, not in xml. the reason is:my old project configure the connection string in some other place, i cannot configure it in 2 places. i already successfully build my NHibernate Session Factory(3 databases, 3 factories), just need to inject my session factory object in the NHibernate Facility, give it an 'id' and 'alias', is it possible ? or any better idea?
thank you in advance !
Have a look to mvc tutorial - persistence step