Update project and dependencies, enable nullable annotations - #20
Merged
Conversation
This was a workaround for a local NuGet feed returning 403 for the vulnerability audit endpoint (NU1900). Committing it disabled package vulnerability auditing for all contributors and CI, and no other Autofac repo sets it.
The previous Quick Start was copied from Autofac.Extras.AggregateService and documented aggregate services. Since this branch adds PackageReadmeFile, that content would have shipped as the NuGet package page. Snippets are adapted from the metadata docs and center on AttributedMetadataModule; the filter attributes in this package are all obsolete in favor of core Autofac.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #20 +/- ##
============================================
- Coverage 71.27% 60.18% -11.10%
============================================
Files 7 7
Lines 94 108 +14
Branches 28 35 +7
============================================
- Hits 67 65 -2
- Misses 12 19 +7
- Partials 15 24 +9 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Brings the library up to current Autofac project standards ahead of the 7.0.0 release.
Changes
where TInterface : notnull(now required by Autofac'sAs<TService>()) is compiler-enforced only.snupkgsymbols, resx-based strings, and the test project now multi-targets net10.0 and net8.0.PackageReadmeFile, that content would have shipped as the NuGet package page.Notes
MetadataModule<TInterface, TMetadata>.ContainerBuilderis nowContainerBuilder?, so the publicRegisterType/RegisterAttributedTypemethods guard it and throwInvalidOperationExceptionwhen called beforeLoad.The README quick start centers on
AttributedMetadataModule, since the filter attributes in this package (WithMetadataAttribute,WithKeyAttribute,WithAttributeFilter) are all[Obsolete]in favor of core Autofac'sAutofac.Features.AttributeFiltersequivalents. Snippets are adapted from the metadata docs and were verified against a scratch test before being committed.Test fix
Does_not_throw_in_nested_lifetimeScope_builderswas failing on the new Autofac. It calledbuilder.RegisterType<int>()inside the child scope's configuration action - two latent bugs from the original 2019 commit:intis a struct, and core Autofac'sRegistrationBuilder.ForType<T>()now rejects non-activatable types, so this threw instead of silently creating a registration nobody resolved.builderinstead of the action'sContainerBuilder, so the nested registration the test name promises never happened.Now
x.RegisterType<NestedLifetimeScopeRegistrationInstance>(). Confirmed the test still guards its original regression by temporarily removing theContainsKeyguard fromAttributedMetadataModule, which reproduces the duplicate-keyArgumentException(nested scopes see parent registrations wrapped inExternalComponentRegistration, which shares the parent's metadata dictionary by reference).Verification
dotnet msbuild ./default.projclean: 30/30 tests pass on net10.0 and net8.0, packages build, and the correct README is packed into the nupkg.