2010/9/8 Eric <[email protected]>

> In the case of the example "uNHAddins.Examples.SessionManagement":
>
> What is the best way to get a reference to the
> "ISessionFactoryImplementor" or "ISessionFactory"? (would there always
> be "one and only one"?)
>

injection, of ISessionFactory. Another way will be to invoke
ServiceLocator.Current.GetInstance<ISessionFActory>() ... I think this
example use an embedded servicelocator, named IoC
... So is something like IoC.Resolve.....



> Essentially, I want to forcibly close any connections if the user is
> closing the data file...
>

I don't get what you said.. here.


>
> From "Program.cs" in SessionManagement.WCF.Host, I see the following:
> var nhConfigurator = new DefaultSessionFactoryConfigurationProvider();
> var sfp = new SessionFactoryProvider(nhConfigurator);
> container.Register(Component.For<ISessionFactoryProvider>().Instance(sfp));
>
> container.Register(Component.For<ISessionWrapper>().ImplementedBy<SessionWrapper>());
>
> container.Register(Component.For<ISessionFactory>().Instance(sfp.GetFactory(null)));
>
> Is this a way to accomplish what I'm looking to do?
>

This is the way you register something in the container.


> What are the reasons for such diversity in IoC and configuration?
>
There is registration for each component. I don't get your question, Could
you make this simpler?

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" 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/nhusers?hl=en.

Reply via email to