563 references to GetService
Aspire.Azure.Messaging.EventHubs (1)
Aspire.Components.Common.Tests (7)
Aspire.Elastic.Clients.Elasticsearch.Tests (1)
Aspire.Hosting (1)
Aspire.Microsoft.EntityFrameworkCore.Cosmos.Tests (3)
Aspire.Microsoft.EntityFrameworkCore.SqlServer.Tests (2)
Aspire.Milvus.Client.Tests (1)
Aspire.MongoDB.Driver (1)
Aspire.MongoDB.Driver.Tests (4)
Aspire.MySqlConnector.Tests (1)
Aspire.NATS.Net.Tests (1)
Aspire.Npgsql.EntityFrameworkCore.PostgreSQL.Tests (3)
Aspire.Npgsql.Tests (1)
Aspire.Oracle.EntityFrameworkCore.Tests (3)
Aspire.Pomelo.EntityFrameworkCore.MySql (1)
Aspire.Pomelo.EntityFrameworkCore.MySql.Tests (4)
Aspire.Qdrant.Client.Tests (1)
Aspire.StackExchange.Redis (3)
BasicTestApp (2)
BasicWebSite (1)
DatabaseErrorPageSample (1)
DependencyInjectionApp (1)
Diagnostics.EFCore.FunctionalTests (11)
IIS.Tests (1)
InProcessWebSite (12)
KeyManagementSample (1)
Microsoft.AspNetCore.Authentication.Abstractions (1)
Microsoft.AspNetCore.Authentication.BearerToken (1)
Microsoft.AspNetCore.Authentication.Certificate (1)
Microsoft.AspNetCore.Authentication.Test (1)
Microsoft.AspNetCore.Authorization.Policy (1)
Microsoft.AspNetCore.Components (3)
Microsoft.AspNetCore.Components.Endpoints (6)
Microsoft.AspNetCore.Components.Endpoints.Tests (1)
Microsoft.AspNetCore.Components.QuickGrid (1)
Microsoft.AspNetCore.Components.Server (3)
Microsoft.AspNetCore.Components.Web (4)
Microsoft.AspNetCore.DataProtection (13)
Microsoft.AspNetCore.DataProtection.EntityFrameworkCore (1)
Microsoft.AspNetCore.DataProtection.Tests (2)
Microsoft.AspNetCore.Diagnostics (2)
Microsoft.AspNetCore.Diagnostics.Middleware.Tests (6)
Microsoft.AspNetCore.Grpc.Swagger (2)
Microsoft.AspNetCore.HeaderPropagation (1)
Microsoft.AspNetCore.Hosting (11)
Microsoft.AspNetCore.Hosting.Tests (42)
WebHostBuilderTests.cs (26)
208Assert.NotNull(host.Services.GetService<ILoggerFactory>());
369Assert.NotNull(host.Services.GetService<IConfiguration>());
410var config = host.Services.GetService<IConfiguration>();
611Assert.Equal(expected, host.Services.GetService<IHostEnvironment>().EnvironmentName);
612Assert.Equal(expected, host.Services.GetService<IWebHostEnvironment>().EnvironmentName);
614Assert.Equal(expected, host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>().EnvironmentName);
615Assert.Equal(expected, host.Services.GetService<Extensions.Hosting.IHostingEnvironment>().EnvironmentName);
659Assert.Equal("/", host.Services.GetService<IHostEnvironment>().ContentRootPath);
660Assert.Equal("/", host.Services.GetService<IWebHostEnvironment>().ContentRootPath);
662Assert.Equal("/", host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>().ContentRootPath);
663Assert.Equal("/", host.Services.GetService<Extensions.Hosting.IHostingEnvironment>().ContentRootPath);
680var basePath2 = host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>().ContentRootPath;
701Assert.Equal(appBase, host.Services.GetService<IHostEnvironment>().ContentRootPath);
703Assert.Equal(appBase, host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>().ContentRootPath);
732var hostingEnv = host.Services.GetService<IHostEnvironment>();
734var hostingEnv2 = host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>();
750var hostingEnv = host.Services.GetService<IHostEnvironment>();
752var hostingEnv2 = host.Services.GetService<AspNetCore.Hosting.IHostingEnvironment>();
768var hostingEnv = host.Services.GetService<IHostEnvironment>();
781var hostingEnv = host.Services.GetService<IHostEnvironment>();
797var hostingEnv = host.Services.GetService<IHostEnvironment>();
813var hostingEnv = host.Services.GetService<IHostEnvironment>();
827var hostingEnv = host.Services.GetService<IHostEnvironment>();
879var factoryFromHost = host.Services.GetService<ILoggerFactory>();
1067var loggerFactory = app.ApplicationServices.GetService<ILoggerFactory>();
1658ServiceA = app.ApplicationServices.GetService<ServiceA>();
Microsoft.AspNetCore.Http (2)
Microsoft.AspNetCore.Http.Connections.Tests (7)
Microsoft.AspNetCore.Http.Extensions (4)
Microsoft.AspNetCore.Http.Extensions.Tests (6)
Microsoft.AspNetCore.Http.Results (3)
Microsoft.AspNetCore.Http.Tests (1)
Microsoft.AspNetCore.HttpLogging (2)
Microsoft.AspNetCore.Identity (1)
Microsoft.AspNetCore.Identity.EntityFrameworkCore (1)
Microsoft.AspNetCore.Identity.EntityFrameworkCore.Test (1)
Microsoft.AspNetCore.Identity.FunctionalTests (1)
Microsoft.AspNetCore.Identity.Specification.Tests (2)
Microsoft.AspNetCore.Identity.Test (8)
Microsoft.AspNetCore.Mvc.Core (5)
Microsoft.AspNetCore.Mvc.Core.Test (1)
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (1)
Microsoft.AspNetCore.Mvc.IntegrationTests (2)
Microsoft.AspNetCore.Mvc.Razor (1)
Microsoft.AspNetCore.Mvc.RazorPages (1)
Microsoft.AspNetCore.Mvc.ViewFeatures (4)
Microsoft.AspNetCore.OpenApi (2)
Microsoft.AspNetCore.OpenApi.Tests (1)
Microsoft.AspNetCore.Owin.Tests (4)
Microsoft.AspNetCore.RateLimiting (1)
Microsoft.AspNetCore.Routing (2)
Microsoft.AspNetCore.Routing.FunctionalTests (2)
Microsoft.AspNetCore.Routing.Tests (1)
Microsoft.AspNetCore.Server.IIS (1)
Microsoft.AspNetCore.Server.IISIntegration.Tests (3)
Microsoft.AspNetCore.Server.Kestrel.Tests (1)
Microsoft.AspNetCore.SignalR (1)
Microsoft.AspNetCore.SignalR.Client.Core (5)
Microsoft.AspNetCore.SignalR.Client.Tests (11)
Microsoft.AspNetCore.SignalR.Core (4)
Microsoft.AspNetCore.SignalR.Microbenchmarks (1)
Microsoft.AspNetCore.SignalR.StackExchangeRedis.Tests (1)
Microsoft.AspNetCore.SignalR.Tests (173)
Microsoft.AspNetCore.SignalR.Tests.Utils (1)
Microsoft.AspNetCore.SpaServices.Extensions (4)
Microsoft.AspNetCore.StaticFiles.FunctionalTests (3)
Microsoft.AspNetCore.TestHost.Tests (5)
Microsoft.AspNetCore.Testing (1)
Microsoft.AspNetCore.Tests (4)
Microsoft.AspNetCore.WebSockets.Tests (1)
Microsoft.Extensions.Caching.Hybrid (3)
Microsoft.Extensions.Caching.Hybrid.Tests (6)
Microsoft.Extensions.Compliance.Redaction.Tests (1)
Microsoft.Extensions.DependencyInjection.Abstractions (1)
Microsoft.Extensions.Diagnostics.ResourceMonitoring.Tests (10)
Microsoft.Extensions.Diagnostics.Testing (1)
Microsoft.Extensions.Diagnostics.Testing.Tests (3)
Microsoft.Extensions.Hosting (1)
Microsoft.Extensions.Hosting.Testing.Tests (4)
Microsoft.Extensions.Http (1)
Microsoft.Extensions.Http.Diagnostics.Tests (8)
Microsoft.Extensions.Http.Polly (1)
Microsoft.Extensions.Http.Polly.Tests (12)
DependencyInjection\PollyHttpClientBuilderExtensionsTest.cs (12)
452var registry = services.GetService<IPolicyRegistry<string>>();
456Assert.Same(registry, services.GetService<IConcurrentPolicyRegistry<string>>());
457Assert.Same(registry, services.GetService<IReadOnlyPolicyRegistry<string>>());
472Assert.Same(registry, services.GetService<IConcurrentPolicyRegistry<string>>());
473Assert.Same(registry, services.GetService<IPolicyRegistry<string>>());
474Assert.Same(registry, services.GetService<IReadOnlyPolicyRegistry<string>>());
489var registry = services.GetService<IPolicyRegistry<string>>();
493Assert.Same(registry, services.GetService<IConcurrentPolicyRegistry<string>>());
494Assert.Same(registry, services.GetService<IReadOnlyPolicyRegistry<string>>());
514Assert.Same(existingRegistry, services.GetService<IPolicyRegistry<string>>());
515Assert.Same(existingRegistry, services.GetService<IConcurrentPolicyRegistry<string>>());
516Assert.Same(existingRegistry, services.GetService<IReadOnlyPolicyRegistry<string>>());
Microsoft.Extensions.Identity.Core (5)
Microsoft.Extensions.ObjectPool.DependencyInjection (1)
Microsoft.Extensions.ObjectPool.DependencyInjection.Tests (4)
Microsoft.Extensions.Telemetry.Abstractions.Tests (1)
Microsoft.Extensions.WebEncoders (1)
Microsoft.ML.AutoML (25)
Microsoft.ML.AutoML.Tests (10)
Microsoft.ML.Fairlearn (3)
NativeIISSample (1)
TestProject.ServiceA (1)