When required properties are used, it is possible for AutoFac to resolve circular dependencies. So it should!
How it should work
When required properties are used, it can be possible for AutoFac to resolve circular dependencies.
It can do this by partially constructing the object and its dependencies via constructor injection
And then filling in all the outstanding dependencies via property injection.
This could work by doing the following:
Create the requested object and only inject constructor args.
Create any dependent objects and only inject constructor args.
Add items from 2 and 3 into a "pool" and resolve any required properties using items from the pool.
Desired Solution
AutoFac can resolve circular dependencies when injected via required properties.
Actually, looking through the docs, it seems like AutoFac already has something like this when using PropertiesAutowired.
I would like to suggest that this be carried over to required properties as well.
Problem Statement
When required properties are used, it is possible for AutoFac to resolve circular dependencies. So it should!
How it should work
When required properties are used, it can be possible for AutoFac to resolve circular dependencies. It can do this by partially constructing the object and its dependencies via constructor injection And then filling in all the outstanding dependencies via property injection.
This could work by doing the following:
Desired Solution
AutoFac can resolve circular dependencies when injected via required properties.
Alternatives You've Considered
Leave it as is.
Additional Context
Resolving circular dependencies would be awesome.