autofac / Autofac

An addictive .NET IoC container
https://autofac.org
MIT License
4.44k stars 836 forks source link

Required properties and Circular Dependencies #1380

Open TonyValenti opened 1 year ago

TonyValenti commented 1 year ago

Problem Statement

AutoFac can resolve circular dependencies when PropertiesAutoWired = true but it cannot when using required properties.

This seems like a minor oversight on the required properties implementation. Injecting into required properties should be able to resolve circular dependencies.

Desired Solution

AutoFac can resolve circular dependencies for required properties.

Alternatives You've Considered

Leave things as-is.

Additional Context

@tillig @alistairjevans

TonyValenti commented 11 months ago

Any chance this could get added sometime?

tillig commented 11 months ago

If you're in a hurry, you can always submit a PR.