Im using
contour for a project and have developed a code first form which inherits
from FormBase. Everything works perfectly find until I try to inject a
dependent service into the constructor.
Im using
ninject as my Ioc container and am simply trying to pass in my unit of work
publicclassContactForm : FormBase
{
..........
"public ContactForm(IUnitOfWork unitOfWork)"
however the default
constructor from FormBase does not accept any parameters.
If you might be
able to point me in the right direction in terms of using a constructor
parameter it would be greatly appreciated.
Ninject DI and Code First
Hi guys,
Im using contour for a project and have developed a code first form which inherits from FormBase. Everything works perfectly find until I try to inject a dependent service into the constructor.
Im using ninject as my Ioc container and am simply trying to pass in my unit of work
public class ContactForm : FormBase
{
..........
"public ContactForm(IUnitOfWork unitOfWork)"
however the default constructor from FormBase does not accept any parameters.
If you might be able to point me in the right direction in terms of using a constructor parameter it would be greatly appreciated.
Kind Regards,
Neil
I think that it's will not work, because Forms not use Factory to create forms.
you use anti pattern for it DependencyResolver.Current.GetService
is working on a reply...