2 implementations of IViewComponentActivator
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
ViewComponents\DefaultViewComponentActivator.cs (1)
17
internal sealed class DefaultViewComponentActivator :
IViewComponentActivator
ViewComponents\ServiceBasedViewComponentActivator.cs (1)
12
public class ServiceBasedViewComponentActivator :
IViewComponentActivator
14 references to IViewComponentActivator
Microsoft.AspNetCore.Mvc.ViewFeatures (7)
DependencyInjection\MvcViewFeaturesMvcBuilderExtensions.cs (1)
53
builder.Services.Replace(ServiceDescriptor.Singleton<
IViewComponentActivator
, ServiceBasedViewComponentActivator>());
DependencyInjection\MvcViewFeaturesMvcCoreBuilderExtensions.cs (1)
173
services.TryAddSingleton<
IViewComponentActivator
, DefaultViewComponentActivator>();
ViewComponents\DefaultViewComponentActivator.cs (1)
10
/// A default implementation of <see cref="
IViewComponentActivator
"/>.
ViewComponents\DefaultViewComponentFactory.cs (3)
15
private readonly
IViewComponentActivator
_activator;
23
/// The <see cref="
IViewComponentActivator
"/> used to create new view component instances.
25
public DefaultViewComponentFactory(
IViewComponentActivator
activator)
ViewComponents\ServiceBasedViewComponentActivator.cs (1)
9
/// A <see cref="
IViewComponentActivator
"/> that retrieves view components as services from the request's
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (7)
DependencyInjection\MvcViewFeaturesMvcBuilderExtensionsTest.cs (2)
31
var descriptor = Assert.Single(builder.Services.ToList(), d => d.ServiceType == typeof(
IViewComponentActivator
));
153
Assert.Equal(typeof(
IViewComponentActivator
), collection[2].ServiceType);
ViewComponentResultTest.cs (1)
670
services.AddSingleton<
IViewComponentActivator
, DefaultViewComponentActivator>();
ViewComponents\DefaultViewComponentFactoryTest.cs (4)
19
var activator = new Mock<
IViewComponentActivator
>();
45
var viewComponentActivator = new Mock<
IViewComponentActivator
>();
68
var viewComponentActivator = new Mock<
IViewComponentActivator
>();
92
var viewComponentActivator = new Mock<
IViewComponentActivator
>();