41 references to GetRequiredService
Aspire.Azure.Messaging.EventHubs.Tests (1)
AspireEventHubsExtensionsTests.cs (1)
466host.Services.GetRequiredService(s_clientTypes[clientIndex]);
Aspire.Confluent.Kafka.Tests (12)
ConsumerConfigurationTests.cs (5)
40: host.Services.GetRequiredService(ReflectionHelpers.ConsumerConnectionFactoryStringKeyStringValueType.Value); 73: host.Services.GetRequiredService(ReflectionHelpers.ConsumerConnectionFactoryStringKeyStringValueType.Value); 106: host.Services.GetRequiredService(ReflectionHelpers.ConsumerConnectionFactoryStringKeyStringValueType.Value); 185: host.Services.GetRequiredService(ReflectionHelpers.ConsumerConnectionFactoryStringKeyStringValueType.Value); 253var connectionFactory = host.Services.GetRequiredService(ReflectionHelpers.ConsumerConnectionFactoryStringKeyStringValueType.Value);
MetricsTests.cs (2)
44object metricsChannel = host.Services.GetRequiredService(ReflectionHelpers.MetricsChannelType.Value!); 161object metricsChannel = host.Services.GetRequiredService(ReflectionHelpers.MetricsChannelType.Value!);
ProducerConfigurationTests.cs (5)
37host.Services.GetRequiredService(ReflectionHelpers.ProducerConnectionFactoryStringKeyStringValueType.Value); 67host.Services.GetRequiredService(ReflectionHelpers.ProducerConnectionFactoryStringKeyStringValueType.Value); 99host.Services.GetRequiredService(ReflectionHelpers.ProducerConnectionFactoryStringKeyStringValueType.Value); 175host.Services.GetRequiredService(ReflectionHelpers.ProducerConnectionFactoryStringKeyStringValueType.Value); 242var connectionFactory = host.Services.GetRequiredService(ReflectionHelpers.ProducerConnectionFactoryStringKeyStringValueType.Value);
Microsoft.Arcade.Common (1)
MSBuildTaskBase.cs (1)
81return GetExecuteParameterTypes().Select(t => serviceProvider.GetRequiredService(t)).ToArray();
Microsoft.AspNetCore.Authentication (1)
AuthenticationHandler.cs (1)
174Events = Context.RequestServices.GetRequiredService(Options.EventsType);
Microsoft.AspNetCore.Components (1)
src\Http\Routing\src\ParameterPolicyActivator.cs (1)
222parameters[i] = serviceProvider.GetRequiredService(parameterType);
Microsoft.AspNetCore.Grpc.JsonTranscoding (1)
src\Grpc\JsonTranscoding\src\Shared\Server\InterceptorPipelineBuilder.cs (1)
180_interceptorActivator = (IGrpcInterceptorActivator)serviceProvider.GetRequiredService(activatorType);
Microsoft.AspNetCore.HeaderParsing (1)
HeaderRegistry.cs (1)
30var parser = setup.ParserInstance ?? (HeaderParser<T>)_provider.GetRequiredService(setup.ParserType!);
Microsoft.AspNetCore.Hosting (1)
Internal\ConfigureBuilder.cs (1)
42parameters[index] = serviceProvider.GetRequiredService(parameterInfo.ParameterType);
Microsoft.AspNetCore.Http (1)
MiddlewareFactory.cs (1)
30return _serviceProvider.GetRequiredService(middlewareType) as IMiddleware;
Microsoft.AspNetCore.Identity (1)
IdentityBuilderExtensions.cs (1)
81builder.Services.AddScoped(typeof(TSignInManager), services => services.GetRequiredService(managerType));
Microsoft.AspNetCore.Identity.Test (2)
IdentityBuilderTest.cs (2)
142var myUserManager = services.BuildServiceProvider().GetRequiredService(typeof(UserManager<PocoUser>)) as MyUserManager; 171var myUserManager = services.BuildServiceProvider().GetRequiredService(typeof(SignInManager<PocoUser>)) as MySignInManager;
Microsoft.AspNetCore.Mvc.Core (5)
Controllers\ServiceBasedControllerActivator.cs (1)
21return actionContext.HttpContext.RequestServices.GetRequiredService(controllerType);
Filters\MiddlewareFilterConfigurationProvider.cs (1)
106parameters[index] = serviceProvider.GetRequiredService(parameterInfo.ParameterType);
ModelBinding\Binders\ServicesModelBinder.cs (1)
27requestServices.GetRequiredService(bindingContext.ModelType);
Routing\DynamicControllerEndpointMatcherPolicy.cs (1)
93transformer = (DynamicRouteValueTransformer)httpContext.RequestServices.GetRequiredService(transformerMetadata.SelectorType);
ServiceFilterAttribute.cs (1)
51var filter = (IFilterMetadata)serviceProvider.GetRequiredService(ServiceType);
Microsoft.AspNetCore.Mvc.Razor (1)
RazorPagePropertyActivator.cs (1)
127var value = serviceProvider.GetRequiredService(property.PropertyType);
Microsoft.AspNetCore.Mvc.RazorPages (2)
Infrastructure\DynamicPageEndpointMatcherPolicy.cs (1)
94transformer = (DynamicRouteValueTransformer)httpContext.RequestServices.GetRequiredService(transformerMetadata.SelectorType);
Infrastructure\ServiceBasedPageModelActivatorProvider.cs (1)
29return context.HttpContext.RequestServices.GetRequiredService(modelType);
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
ViewComponents\ServiceBasedViewComponentActivator.cs (1)
21return context.ViewContext.HttpContext.RequestServices.GetRequiredService(viewComponentType);
Microsoft.AspNetCore.Routing (1)
ParameterPolicyActivator.cs (1)
222parameters[i] = serviceProvider.GetRequiredService(parameterType);
Microsoft.AspNetCore.SignalR.Core (1)
Internal\HubMethodDescriptor.cs (1)
201return serviceProvider.GetRequiredService(parameterType);
Microsoft.Extensions.DependencyInjection.Abstractions (2)
ServiceProviderServiceExtensions.cs (2)
65return (T)provider.GetRequiredService(typeof(T)); 94return (IEnumerable<object>)provider.GetRequiredService(genericEnumerable);
Microsoft.Extensions.DependencyInjection.AutoActivation (1)
AutoActivationHostedService.cs (1)
28_ = _provider.GetRequiredService(singleton);
Microsoft.Extensions.Identity.Core (3)
IdentityBuilder.cs (2)
184Services.AddScoped(customType, services => services.GetRequiredService(userManagerType)); 270Services.AddScoped(typeof(TRoleManager), services => services.GetRequiredService(managerType));
UserManager.cs (1)
112provider = (IUserTwoFactorTokenProvider<TUser>)services.GetRequiredService(providerType);
SocialWeather (1)
FormatterResolver.cs (1)
36return (IStreamFormatter<T>)_serviceProvider.GetRequiredService(typeFormatterType);