4 writes to ViewContext
Microsoft.AspNetCore.Mvc.ViewFeatures (2)
ViewComponents\ViewComponentContext.cs (2)
26
ViewContext
= new ViewContext();
58
ViewContext
= new ViewContext(
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (2)
ViewComponents\DefaultViewComponentActivatorTests.cs (1)
89
ViewContext
= new ViewContext
ViewComponentTests.cs (1)
245
viewComponentContext.
ViewContext
= viewContext;
24 references to ViewContext
Microsoft.AspNetCore.Mvc.ViewFeatures (16)
MvcViewFeaturesDiagnosticListenerExtensions.cs (4)
33
context.
ViewContext
.ActionDescriptor,
60
context.
ViewContext
.ActionDescriptor,
87
context.
ViewContext
.ActionDescriptor,
113
context.
ViewContext
.ActionDescriptor,
ViewComponent.cs (4)
87
var services = ViewComponentContext.
ViewContext
?.HttpContext?.RequestServices;
89
_url = factory?.GetUrlHelper(ViewComponentContext.
ViewContext
!);
129
public ViewContext ViewContext => ViewComponentContext.
ViewContext
;
151
var services = ViewComponentContext.
ViewContext
?.HttpContext?.RequestServices;
ViewComponents\DefaultViewComponentActivator.cs (1)
49
context.
ViewContext
.HttpContext.RequestServices,
ViewComponents\ServiceBasedViewComponentActivator.cs (1)
21
return context.
ViewContext
.HttpContext.RequestServices.GetRequiredService(viewComponentType);
ViewComponents\ViewComponentContext.cs (4)
37
/// <param name="viewContext">The <see cref="
ViewContext
"/>.</param>
103
public ViewDataDictionary ViewData =>
ViewContext
.ViewData;
111
public ITempDataDictionary TempData =>
ViewContext
.TempData;
119
public TextWriter Writer =>
ViewContext
.Writer;
ViewComponents\ViewViewComponentResult.cs (2)
73
var viewContext = context.
ViewContext
;
131
return context.
ViewContext
.HttpContext.RequestServices.GetRequiredService<ICompositeViewEngine>();
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (8)
ViewComponents\ViewComponentContextTest.cs (6)
45
Assert.NotSame(viewContext, viewComponentContext.
ViewContext
);
47
Assert.Same(viewContext.View, viewComponentContext.
ViewContext
.View);
48
Assert.Same(viewContext.Writer, viewComponentContext.
ViewContext
.Writer);
51
Assert.Same(viewComponentContext.
ViewContext
.ViewData, viewComponentContext.ViewData);
52
Assert.Same(viewComponentContext.
ViewContext
.TempData, viewComponentContext.TempData);
53
Assert.Same(viewComponentContext.
ViewContext
.Writer, viewComponentContext.Writer);
ViewComponents\ViewViewComponentResultTest.cs (2)
365
viewComponentContext.
ViewContext
.HttpContext.RequestServices = serviceProvider.Object;
439
viewComponentContext.
ViewContext
.HttpContext.RequestServices = serviceProvider;