Introduction
Constructor/property dependencies
Register the class that has the property dependency with the InjectUnsetProperties handler on Activated, e.g.:
class DependsByCtor
{
public DependsByCtor(DependsByProp dependency) { }
}
class DependsByProp
{
public DependsByCtor Dependency { get; set; }
}
// ...
var cb = new ContainerBuilder();
cb.Register<DependsByCtor>();
cb.Register<DependsByProp>().OnActivated(ActivatedHandler.InjectUnsetProperties);
Note, it doesn't make sense to set up this scenario if both classes are registered with Factory scope.
Constructor/constructor dependencies
Not handled - integration of DynamicProxy should do the trick though (post to the newsgroup if you're interested in trying.)
In version 1.0.2 and later (not released at time of writing.)
What about property/property dependencies which are not SingleInstance?()-ed? I know this doesn't make much sense from Autofac's standpoint but what are some ways to do it?