<PackageReference Include="Microsoft.Extensions.DependencyInjection.Abstractions" Version="10.0.0-preview.2.25163.2" />

IServiceProviderIsService

public interface IServiceProviderIsService
Provides methods to determine if the specified type is available from the IServiceProvider.
using System; using System.Runtime.CompilerServices; namespace Microsoft.Extensions.DependencyInjection { [NullableContext(1)] public interface IServiceProviderIsService { bool IsService(Type serviceType); } }