This project is read-only.

Issue with using LinqToSqlSession


I am having an issue when trying to use the LinqToSqlSession. The file has a protected constructor which I changed to public. Then when I run the application, I'm getting an injection error in the log. What I can't figure out is how the constructor that takes the datacontext as a param gets called. It seems Ninject can't map it properly.

Message :Error activating string
No matching bindings are available, and the type is not self-bindable.
Activation path:
4) Injection of dependency string into parameter fileOrServerOrConnection of constructor of type DataContext
3) Injection of dependency DataContext into parameter dc of constructor of type LinqToSqlSession
2) Injection of dependency ISession into parameter session of constructor of type SessionController
1) Request for IController

1) Ensure that you have defined a binding for string.
2) If the binding was defined in a module, ensure that the module has been loaded into the kernel.
3) Ensure you have not accidentally created more than one kernel.
4) If you are using automatic module loading, ensure the search path and filters are correct.


vedbu wrote Jun 27, 2010 at 11:25 PM

This is the constructor in the LinqToSqlSession class:
    public LinqToSqlSession(DataContext dc) {
        _db = dc;

vedbu wrote Jun 28, 2010 at 7:13 PM

My mistake. I should be binding to SiteLinqtoSqlSession.

sp4ceman wrote Jul 14, 2010 at 10:34 AM

Please outline the steps you took to fix this error, I'm running into the same thing.
How do I bind to a "SiteLinqToSqlSession"?

sp4ceman wrote Jul 19, 2010 at 2:21 PM

Nevermind, I was being dumb.