1 write to ServiceType
Microsoft.Extensions.DependencyInjection.Abstractions (1)
267 references to ServiceType
Aspire.Hosting.Testing (1)
Aspire.Hosting.Testing.Tests (1)
Aspire.Hosting.Tests (1)
Aspire.Microsoft.EntityFrameworkCore.Cosmos (3)
Aspire.Microsoft.EntityFrameworkCore.Cosmos.Tests (1)
Aspire.Microsoft.EntityFrameworkCore.SqlServer (3)
Aspire.Microsoft.EntityFrameworkCore.SqlServer.Tests (5)
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL (3)
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL.Tests (5)
Aspire.Oracle.EntityFrameworkCore (3)
Aspire.Oracle.EntityFrameworkCore.Tests (5)
Aspire.Pomelo.EntityFrameworkCore.MySql (3)
Aspire.Pomelo.EntityFrameworkCore.MySql.Tests (5)
Microsoft.AspNetCore (2)
Microsoft.AspNetCore.AsyncState.Tests (2)
Microsoft.AspNetCore.Authentication.Test (1)
Microsoft.AspNetCore.Components.Endpoints.Tests (10)
Microsoft.AspNetCore.Components.WebAssembly.Tests (1)
Microsoft.AspNetCore.DataProtection.Tests (2)
Microsoft.AspNetCore.HeaderParsing (1)
Microsoft.AspNetCore.Hosting.Tests (3)
Microsoft.AspNetCore.Http.Extensions.Tests (8)
Microsoft.AspNetCore.Identity.UI (1)
Microsoft.AspNetCore.Mvc.Core (1)
Microsoft.AspNetCore.Mvc.Core.Test (12)
Microsoft.AspNetCore.Mvc.FunctionalTests (1)
Microsoft.AspNetCore.Mvc.Localization.Test (17)
Microsoft.AspNetCore.Mvc.NewtonsoftJson (3)
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (5)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation (2)
Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation.Test (3)
Microsoft.AspNetCore.Mvc.Razor.Test (8)
Microsoft.AspNetCore.Mvc.RazorPages (1)
Microsoft.AspNetCore.Mvc.Test (24)
MvcServiceCollectionExtensionsTest.cs (24)
240Assert.Contains(services, s => s.ServiceType == typeof(IActionInvokerProvider) && s.ImplementationType == typeof(ControllerActionInvokerProvider));
242Assert.Contains(services, s => s.ServiceType == typeof(IApiDescriptionGroupCollectionProvider));
244Assert.Contains(services, s => s.ServiceType == typeof(CorsAuthorizationFilter));
246Assert.Contains(services, s => s.ServiceType == typeof(IConfigureOptions<MvcOptions>) && s.ImplementationType == typeof(MvcDataAnnotationsMvcOptionsSetup));
248Assert.Contains(services, s => s.ServiceType == typeof(FormatFilter));
250Assert.Contains(services, s => s.ServiceType == typeof(IHtmlHelper));
252Assert.Contains(services, s => s.ServiceType == typeof(IRazorViewEngine));
254Assert.Contains(services, s => s.ServiceType == typeof(CacheTagHelperMemoryCacheFactory));
257Assert.DoesNotContain(services, s => s.ServiceType == typeof(IActionInvokerProvider) && s.ImplementationType == typeof(PageActionInvokerProvider));
266if (singleRegistrationServiceTypes.Contains(service.ServiceType))
269AssertServiceCountEquals(services, service.ServiceType, 1);
287AssertContainsSingle(services, service.ServiceType, service.ImplementationType);
310var descriptor = Assert.Single(services, d => d.ServiceType == typeof(ApplicationPartManager));
338var descriptor = Assert.Single(services, d => d.ServiceType == typeof(ApplicationPartManager));
364var descriptor = Assert.Single(services, d => d.ServiceType == typeof(ApplicationPartManager));
388var descriptor = Assert.Single(services, d => d.ServiceType == typeof(ApplicationPartManager));
418foreach (var serviceType in services.Select(d => d.ServiceType).Where(t => !t.IsGenericTypeDefinition).Distinct())
436var descriptor = Assert.Single(services, item => item.ServiceType == typeof(ITempDataProvider));
452item => item.ServiceType == typeof(IConfigureOptions<CookieTempDataProviderOptions>));
465.Where(sd => !multiRegistrationServiceTypes.ContainsKey(sd.ServiceType))
466.Where(sd => sd.ServiceType.Assembly.FullName.Contains("Mvc"))
467.Select(sd => sd.ServiceType);
619var serviceDescriptors = services.Where(serviceDescriptor => serviceDescriptor.ServiceType == serviceType);
636sd.ServiceType == serviceType &&
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (20)
Microsoft.AspNetCore.OpenApi.Tests (18)
Extensions\OpenApiServiceCollectionExtensionsTests.cs (18)
38Assert.Contains(services, sd => sd.ServiceType == typeof(OpenApiSchemaService) && sd.Lifetime == ServiceLifetime.Singleton && (string)sd.ServiceKey == documentName);
39Assert.Contains(services, sd => sd.ServiceType == typeof(OpenApiDocumentService) && sd.Lifetime == ServiceLifetime.Singleton && (string)sd.ServiceKey == documentName);
40Assert.Contains(services, sd => sd.ServiceType == typeof(IDocumentProvider) && sd.Lifetime == ServiceLifetime.Singleton);
72Assert.Contains(services, sd => sd.ServiceType == typeof(OpenApiSchemaService) && sd.Lifetime == ServiceLifetime.Singleton && (string)sd.ServiceKey == documentName);
73Assert.Contains(services, sd => sd.ServiceType == typeof(OpenApiDocumentService) && sd.Lifetime == ServiceLifetime.Singleton && (string)sd.ServiceKey == documentName);
74Assert.Contains(services, sd => sd.ServiceType == typeof(IDocumentProvider) && sd.Lifetime == ServiceLifetime.Singleton);
105Assert.Contains(services, sd => sd.ServiceType == typeof(OpenApiSchemaService) && sd.Lifetime == ServiceLifetime.Singleton && (string)sd.ServiceKey == documentName);
106Assert.Contains(services, sd => sd.ServiceType == typeof(OpenApiDocumentService) && sd.Lifetime == ServiceLifetime.Singleton && (string)sd.ServiceKey == documentName);
107Assert.Contains(services, sd => sd.ServiceType == typeof(IDocumentProvider) && sd.Lifetime == ServiceLifetime.Singleton);
138Assert.Contains(services, sd => sd.ServiceType == typeof(OpenApiSchemaService) && sd.Lifetime == ServiceLifetime.Singleton && (string)sd.ServiceKey == documentName);
139Assert.Contains(services, sd => sd.ServiceType == typeof(OpenApiDocumentService) && sd.Lifetime == ServiceLifetime.Singleton && (string)sd.ServiceKey == documentName);
140Assert.Contains(services, sd => sd.ServiceType == typeof(IDocumentProvider) && sd.Lifetime == ServiceLifetime.Singleton);
160Assert.Contains(services, sd => sd.ServiceType == typeof(OpenApiSchemaService) && sd.Lifetime == ServiceLifetime.Singleton && (string)sd.ServiceKey == documentName);
161Assert.Contains(services, sd => sd.ServiceType == typeof(OpenApiDocumentService) && sd.Lifetime == ServiceLifetime.Singleton && (string)sd.ServiceKey == documentName);
162Assert.Contains(services, sd => sd.ServiceType == typeof(IDocumentProvider) && sd.Lifetime == ServiceLifetime.Singleton);
184Assert.Contains(services, sd => sd.ServiceType == typeof(OpenApiSchemaService) && sd.Lifetime == ServiceLifetime.Singleton && (string)sd.ServiceKey == documentName);
185Assert.Contains(services, sd => sd.ServiceType == typeof(OpenApiDocumentService) && sd.Lifetime == ServiceLifetime.Singleton && (string)sd.ServiceKey == documentName);
186Assert.Contains(services, sd => sd.ServiceType == typeof(IDocumentProvider) && sd.Lifetime == ServiceLifetime.Singleton);
Microsoft.AspNetCore.Tests (16)
WebApplicationTests.cs (16)
1753Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(IConfigureOptions<LoggerFactoryOptions>)));
1755Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(IWebHostEnvironment)));
1756Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(IOptionsChangeTokenSource<HostFilteringOptions>)));
1757Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(IServer)));
1758Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(EndpointDataSource)));
1773Assert.DoesNotContain(builder.Services, descriptor => descriptor.ServiceType == typeof(IConfigureOptions<LoggerFactoryOptions>));
1774Assert.DoesNotContain(builder.Services, descriptor => descriptor.ServiceType == typeof(IOptionsChangeTokenSource<HostFilteringOptions>));
1775Assert.DoesNotContain(builder.Services, descriptor => descriptor.ServiceType == typeof(IServer));
1776Assert.DoesNotContain(builder.Services, descriptor => descriptor.ServiceType == typeof(EndpointDataSource));
1779Assert.Single(builder.Services.Where(descriptor => descriptor.ServiceType == typeof(IWebHostEnvironment)));
2421Assert.Contains(builder.Services, service => service.ServiceType == typeof(HostBuilderContext));
2422Assert.Contains(builder.Services, service => service.ServiceType == typeof(IHostApplicationLifetime));
2423Assert.Contains(builder.Services, service => service.ServiceType == typeof(IHostLifetime));
2424Assert.Contains(builder.Services, service => service.ServiceType == typeof(IOptions<>));
2425Assert.Contains(builder.Services, service => service.ServiceType == typeof(ILoggerFactory));
2426Assert.Contains(builder.Services, service => service.ServiceType == typeof(ILogger<>));
Microsoft.DotNet.Internal.DependencyInjection.Testing (2)
Microsoft.Extensions.AsyncState.Tests (3)
Microsoft.Extensions.Caching.SqlServer.Tests (2)
Microsoft.Extensions.Caching.StackExchangeRedis.Tests (3)
Microsoft.Extensions.DependencyInjection (12)
Microsoft.Extensions.DependencyInjection.Abstractions (15)
Microsoft.Extensions.DependencyInjection.AutoActivation (10)
Microsoft.Extensions.Diagnostics.HealthChecks.Tests (7)
Microsoft.Extensions.Http (3)
Microsoft.Extensions.Http.Polly.Tests (6)
Microsoft.Extensions.Http.Resilience.Tests (1)
Microsoft.Extensions.Localization.Tests (1)
Microsoft.Extensions.Resilience (1)