v3: Provide IServiceProviderIsService#4
Merged
dustinsoftware merged 4 commits intodustinsoftware:mainfrom Jun 16, 2025
Merged
Conversation
ea937f3 to
6a3c95c
Compare
6a3c95c to
da170ca
Compare
dahlbyk
commented
Jun 13, 2025
src/StructureMap.Microsoft.DependencyInjection/StructureMapServiceProviderIsService.cs
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
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
Owner
dustinsoftware
left a comment
There was a problem hiding this comment.
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
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.
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.