Skip to content

Conversation

@dahlbyk
Copy link
Collaborator

@dahlbyk dahlbyk commented Jun 12, 2025

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.

@dahlbyk dahlbyk force-pushed the IServiceProviderIsService branch from ea937f3 to 6a3c95c Compare June 12, 2025 20:10
@dahlbyk dahlbyk force-pushed the IServiceProviderIsService branch from 6a3c95c to da170ca Compare June 12, 2025 20:16
@dustinsoftware dustinsoftware requested a review from Copilot June 16, 2025 18:26
Copy link

Copilot AI left a 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 StructureMapServiceProviderIsService to conform to IServiceProviderIsService
  • 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 spis is cryptic; consider renaming it to something like isServiceProvider or serviceChecker for 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 to Microsoft.Extensions.DependencyInjection v6.
// Added in MEDI v6

Copy link
Owner

@dustinsoftware dustinsoftware left a 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.

@dahlbyk dahlbyk force-pushed the IServiceProviderIsService branch from c2c5b8b to 0890ecb Compare June 16, 2025 18:48
@dustinsoftware dustinsoftware merged commit 8a94e10 into dustinsoftware:main Jun 16, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants