Autofac begin lifetimescope per activated instance
Given following code:
interface IMain {}
interface ISub {}
interface IDep {}
class Dep : IDep
{
public Dep(ISub sub) { ... }
}
class Main : IMain
{
public Main() {}
public IEnumerable<IDep> Dependencies {get;set}
}
How can i configure the container to have one single instance of ISub per
IMain instance. So if I resolve an IMain instance from the container, a
'single instance' of ISub is created for that IMain object.
No comments:
Post a Comment