HI, to all, i am use Structure Map to implement dependency-injection. I created ModelStateWrapper class to send Model state in service layer, which in constructor get reference to ModelState of controller. In bootswrapper i registered my type:
ForRequestedType<ISourceService>()
.TheDefaultIsConcreteType<SourceService>();
ForRequestedType<IValidationDictionary>()
.TheDefaultIsConcreteType<ModelStateWrapper>();
How i can give reference of controller's model state to ModelStateWrapper here ?
p.s. sorry for my english :)
You need to provide more information, but this is my best guess as to what you have:
If you want to pass a variable (the controller's model state in this case) to the ModelStateWrapper you almost certainly need to do that explicitly by calling the ObjectFactory.
Example:
See this documentation for details:
Passing Arguments to StructureMap at Runtime