No Parameterless Constructor defined for - ViewModel with UOW
- by TheVillageIdiot
I have a view model class which uses UnitOfWork to some database operations like fetching of items to create select lists and IPrincipal for some auditing (like modified by etc.). It cannot work without this UOW. I have configured my web site to use Ninject to inject UOW into Controllers. From controller I pass this UOW when creating view model. But when performing POST operation I am getting
No parameterless constructor defined for this object.
I have few SelectList type of properties which I have excluded with Bind attribute.
How can I overcome this problem? Can I configure Ninject to create the objects of this type and make ModelBinder use it?