Skip to content

Update How to Get an Instance of IServiceProvider sample to .NET 11 - #2414

Open
vladimir-pecanac-main wants to merge 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/123560-get-an-instance-of-iserviceprovider
Open

vladimir-pecanac-main wants to merge 1 commit into
CodeMazeBlog:mainfrom
vladimir-pecanac-main:seo/123560-get-an-instance-of-iserviceprovider

Conversation

@vladimir-pecanac-main

Copy link
Copy Markdown
Collaborator

Moves both projects in dotnet-dependency-injection/HowToGetAnInstanceOfIServiceProvider to net11.0, replaces Swashbuckle with Microsoft.AspNetCore.OpenApi 11.0.0 (AddOpenApi and MapOpenApi, launch URL openapi/v1.json), disposes the startup scope with a using declaration, renames the background service's primary constructor parameter to camelCase, updates the test packages (xunit 2.9.3, xunit.runner.visualstudio 4.0.1, Microsoft.NET.Test.Sdk 18.12.0, coverlet.collector 10.1.0, Microsoft.Extensions.DependencyInjection 11.0.0, the now redundant Hosting.Abstractions reference removed) and adds a test showing that GetService returns null and GetRequiredService throws for an unregistered service.

Target net11.0, replace Swashbuckle with Microsoft.AspNetCore.OpenApi 11.0.0, dispose the startup scope with using, camelCase the background service's primary constructor parameter, update the test packages and add a test for GetService versus GetRequiredService on an unregistered service.
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.

1 participant