I have following service class:
public class MyService : IService
{
public MyService(Func<string,bool> question)
{
....
}
...
}
When I use this service in my WinForms application I want to pass following code as MyService constructor parameter
(string question) =>
{
var questionForm = new SimpleQuestionForm(question);
if(questionForm.ShowDialog() == DialogResult.OK)
return true;
else
return false;
}
How can I tell to the StructureMap that what is my question delegate?
I defined following Registry class in my WindowsForm project:
And then added registry to the ObjectFactory's Container by following code in the start of the project's
Program.cs:For relosving: