Fluent or no fluent, it should work the same.

in App_Start:
{
var config = Fluently.Configure()
...
    .BuildConfiguration();

sessionFactory = config.BuildSessionFactory();
}

in BeginRequest:
{
    var session = sessionFactory.OpenSession();
    CurrentSessionContext.Bind(session);
}

in EndRequest:
{
    var session = sessionFactory.GetCurrentSession();
    CurrentSessionContext.UnBind(session);
    // deal with session close and dispose
}

in the container setup:
{

container.Register(Component.For<ISessionFactory>().Instance(sessionFactory));
}


if you need several sessionFactories (say for multi-tenant apps), then you'd
create them by key or something, and then instead of registering the single
ISessionFactory instance, you can use the FactorySupportFacility to supply
an ISessionFactory to services in a context sensitive maner




On Sat, Apr 25, 2009 at 7:12 PM, Wayne Douglas <wa...@codingvista.com>wrote:

> Can anyone point me to a good tutorial/example of using Windsor + FluentNH
> +  in a web environment?
>
> --
> Cheers,
>
> w://
>
> >
>


-- 
Ken Egozi.
http://www.kenegozi.com/blog
http://www.delver.com
http://www.musicglue.com
http://www.castleproject.org
http://www.gotfriends.co.il

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

Reply via email to