Hi, in tutorial Validating with a service layer constructor for Product Service looks like this:
ProductService(IValidationDictionary validationDictionary, IProductRepository repository)
and its instance in default controller constructor is created like this:
public ProductController()
{
_service = new ProductService(new ModelStateWrapper(this.ModelState), new roductRepository());
}
If I want to use Unity for DI, second constructor should obviously be used.
public ProductController(IProductService service)
{
_service = service;
}
But then I do not not know to configure Unity to inject first parameter of ProductServise,because ModelStateWrapper uses ModelState from controller, which is created inside controller and cannot be injected.Is it possible to inject such dependency to ProductService?