-
Notifications
You must be signed in to change notification settings - Fork 1
v3: Provide IServiceProviderIsService
#4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v3: Provide IServiceProviderIsService
#4
Conversation
ea937f3 to
6a3c95c
Compare
6a3c95c to
da170ca
Compare
src/StructureMap.Microsoft.DependencyInjection/StructureMapServiceProviderIsService.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR introduces support for the new IServiceProviderIsService interface from MEDI v6, ensuring consumers can query service availability directly.
- Implements
StructureMapServiceProviderIsServiceto conform toIServiceProviderIsService - Registers the new provider-inquiring service in
ContainerExtensions - Updates tests and package references to target Microsoft.Extensions.DependencyInjection v6
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| test/StructureMap.Microsoft.DependencyInjection.Tests/StructureMapContainerTests.cs | Add assertions for IServiceProviderIsService.IsService |
| test/StructureMap.Microsoft.DependencyInjection.Tests/StructureMap.Microsoft.DependencyInjection.Tests.csproj | Bump test package references to DI v6 |
| src/StructureMap.Microsoft.DependencyInjection/StructureMapServiceProviderIsService.cs | New implementation of IServiceProviderIsService |
| src/StructureMap.Microsoft.DependencyInjection/StructureMap.Microsoft.DependencyInjection.csproj | Update DI.Abstractions reference to v6 |
| src/StructureMap.Microsoft.DependencyInjection/ContainerExtensions.cs | Register IServiceProviderIsService in the container profile |
| src/Directory.Build.props | Bump library version prefix to 3.0.0 |
Comments suppressed due to low confidence (2)
test/StructureMap.Microsoft.DependencyInjection.Tests/StructureMapContainerTests.cs:63
- [nitpick] The variable name
spisis cryptic; consider renaming it to something likeisServiceProviderorserviceCheckerfor clarity.
var spis = container.GetInstance<IServiceProviderIsService>();
src/StructureMap.Microsoft.DependencyInjection/ContainerExtensions.cs:140
- [nitpick] The comment uses the abbreviation
MEDI v6, which may not be immediately clear to new readers. Consider expanding it toMicrosoft.Extensions.DependencyInjection v6.
// Added in MEDI v6
src/StructureMap.Microsoft.DependencyInjection/StructureMapServiceProviderIsService.cs
Show resolved
Hide resolved
dustinsoftware
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see tests to check that IServiceProviderIsService resolves but not any that verifies the behavior in it. Happy to merge as-is if those aren't trivial to add.
test/StructureMap.Microsoft.DependencyInjection.Tests/StructureMapContainerTests.cs
Show resolved
Hide resolved
c2c5b8b to
0890ecb
Compare
MEDI v6 adds
IServiceProviderIsService, which a handful of our projects have (naively) implemented to satisfy https://www.nuget.org/packages/Microsoft.AspNetCore.Mvc.ApiExplorer. Might as well implement once with passing specs.