Answer the question
In order to leave comments, you need to log in
How to Resolve for Action parameters in autofac?
Here is an example:
public class TaskWrapper : ITaskWrapper
{
public TaskWrapper(Action action)
{
this.action = action;
}
}
public void Connect()
{
Program.Container.Resolve<TaskWrapper>(new NamedParameter("action", ToConnect)); // не работает!
Program.Container.Resolve<TaskWrapper>(new TypedParameter(typeof(Action), ToConnect)); // не работает!
}
private void ToConnect()
{
// some code...
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question