dadhi / DryIoc

DryIoc is fast, small, full-featured IoC Container for .NET
MIT License
988 stars 122 forks source link

Add the rule for the injection of C#11 required properties via the rule PropertiesAndFields.RequiredProperties #571

Closed dadhi closed 1 year ago

dadhi commented 1 year ago

Can be applied like this:

var c = new Container(Rules.Default.With(propertiesAndFields: PropertiesAndFields.RequiredProperties()));
dadhi commented 1 year ago

Here are the tests https://github.com/dadhi/DryIoc/blob/master/test/DryIoc.UnitTests/RequiredPropertiesTests.cs