Im very new to Ninject. I want to find a way to pass Modelstate of a controller further to service layer.
what i have right now:
private readonly IAccountService service;
public AccountController(ILanguageService ls, ISessionHelper sh)
{
this.service = new AccountService(new ModelStateWrapper(this.ModelState));
this.languageService = ls;
this.sessionHelper = sh;
}
public AccountService(IValidationDictionary validationDictionary)
{
this.validationDictionary = validationDictionary;
}
want i want to get to in some way:
private readonly IAccountService service;
public AccountController(ILanguageService ls, ISessionHelper sh, IAccountService as)
{
this.service = as;
this.languageService = ls;
this.sessionHelper = sh;
}
public AccountService(IValidationDictionary validationDictionary)
{
this.validationDictionary = validationDictionary;
}
But like you see AccountService will never be able to receive IValidationDictionary because it was never sent from AccountController as a prameter.
Is it possible to achieve that? or is this just one of the things i have to live with?