Imagine we have a class
public class MyClass
{
private string _val;
public MyClass(string val)
{
_val = val;
}
}
and app.config (or web.config)
<appSettings>
<add key="value" value="some value" />
</appSettings>
Is there way to register type MyClass in Unity container and point Unity to inject value for val constructor parameter from config file?