Using MEF, I know you can do this to import your interface:
class MyClass
{
[Import(typeof(IUser))]
private IUser m_userName;
}
Can I do something similar but within the method? For example, this below does not compile:
class MyClass
{
public void DoWork()
{
[Import(typeof(IUser))]
IUser userName;
userName.dosoething();
}
}