Dmitri, it doesn't work if you pass the interface type to session.Services.Get<>()
service is null! |
Ara, I think, I've got the idea. Note the
I'm sorry for your inconvenience. We should have added service-related part in the manual long time ago. |
There should be no any difference in this case. Integrated IoC container fully relies on types passed to Try to set a breakpoint in service constructor, see the stack trace when it's hit @ MVC app, and try to do the same in the test project. If BP won't be hit, try to set breakpoints @ expected callers from the MVC app stack. If this won't expose the issue, please send us a sample. We'll try to investigate the issue here. Can you guys confirm that with v4.4 you are able to retrieve a ISessionService instance in a project that does NOT use your SessionManager? Is there an example you can provide? Ara, I've checked the SqlDirectAccessorTest from the manual and can confirm that it doesn't fail, so the instance of SqlDirectAccessor which implements ISessionService is retrieved successfully. See my update in the original question. DirectSqlAccessor works because it is the class type. If you pass an interface type, it doesn't work. Actually, DirectSqlAccessor works because it is a native DO service. Even passing the concrete implementation, MyService, as the type parameter doesn't work. Ara, is your service declaration located in the same assembly as domain model? If not, are you registering types from that assembly in Same assembly. Try the example I posted.. you'll see that it doesn't work =( I even try config.Types.Register(typeof(IMyService)) and config.Types.Register(typeof(MyService)). Still doesn't work. I see. I just wanted to be sure that I'd understood the conditions correctly. Will check this shortly. Thanks, Dmitri. And just to confirm... this is in 4.4 |