9 writes to ViewContext
Microsoft.AspNetCore.Mvc.Razor.Test (4)
TagHelpers\UrlResolutionTagHelperTest.cs (4)
115ViewContext = new Rendering.ViewContext { HttpContext = new DefaultHttpContext() } 175ViewContext = new Rendering.ViewContext { HttpContext = new DefaultHttpContext() } 369ViewContext = new Rendering.ViewContext { HttpContext = new DefaultHttpContext() } 415ViewContext = new Rendering.ViewContext { HttpContext = httpContext }
Microsoft.AspNetCore.Mvc.TagHelpers.Test (5)
ImageTagHelperTest.cs (2)
195helper.ViewContext = viewContext; 329ViewContext = viewContext,
LinkTagHelperTest.cs (2)
822helper.ViewContext = viewContext; 1118ViewContext = viewContext,
ScriptTagHelperTest.cs (1)
1086ViewContext = viewContext,
33 references to ViewContext
Microsoft.AspNetCore.Mvc.Razor (4)
TagHelpers\UrlResolutionTagHelper.cs (4)
110/// The <see cref="ViewContext"/>. 228var urlHelper = UrlHelperFactory.GetUrlHelper(ViewContext); 253var urlHelper = UrlHelperFactory.GetUrlHelper(ViewContext); 340return ViewContext.HttpContext.GetEndpoint()?.Metadata.GetMetadata<ResourceAssetCollection>();
Microsoft.AspNetCore.Mvc.TagHelpers (12)
ImageTagHelper.cs (3)
136FileVersionProvider = ViewContext.HttpContext.RequestServices.GetRequiredService<IFileVersionProvider>(); 144var pathBase = ViewContext.HttpContext.Request.PathBase; 145if (ResourceCollectionUtilities.TryResolveFromAssetCollection(ViewContext, url, out var resolvedUrl))
LinkTagHelper.cs (4)
477ViewContext.HttpContext.Request.PathBase); 485FileVersionProvider = ViewContext.HttpContext.RequestServices.GetRequiredService<IFileVersionProvider>(); 536var pathBase = ViewContext.HttpContext.Request.PathBase; 538if (ResourceCollectionUtilities.TryResolveFromAssetCollection(ViewContext, url, out var resolvedUrl))
ScriptTagHelper.cs (5)
247var importMap = ImportMap ?? ViewContext.HttpContext.GetEndpoint()?.Metadata.GetMetadata<ImportMapDefinition>(); 416var pathBase = ViewContext.HttpContext.Request.PathBase; 417if (ResourceCollectionUtilities.TryResolveFromAssetCollection(ViewContext, srcValue, out var resolvedUrl)) 465ViewContext.HttpContext.Request.PathBase); 473FileVersionProvider = ViewContext.HttpContext.RequestServices.GetRequiredService<IFileVersionProvider>();
Microsoft.AspNetCore.Mvc.TagHelpers.Test (17)
ImageTagHelperTest.cs (3)
196helper.ViewContext.HttpContext = new DefaultHttpContext(); 197helper.ViewContext.HttpContext.SetEndpoint(CreateEndpoint()); 200helper.ViewContext.HttpContext.Request.PathBase = new PathString(pathBase);
LinkTagHelperTest.cs (5)
750helper.ViewContext.HttpContext.SetEndpoint(CreateEndpoint()); 791helper.ViewContext.HttpContext.SetEndpoint(CreateEndpoint()); 792helper.ViewContext.HttpContext.Request.PathBase = "/approot"; 925helper.ViewContext.HttpContext.SetEndpoint(CreateEndpoint()); 1080helper.ViewContext.HttpContext.SetEndpoint(CreateEndpoint());
ScriptTagHelperTest.cs (9)
659helper.ViewContext.HttpContext.SetEndpoint(CreateEndpoint()); 696helper.ViewContext.HttpContext.SetEndpoint(CreateEndpoint()); 697helper.ViewContext.HttpContext.Request.PathBase = "/approot"; 742helper.ViewContext.HttpContext.SetEndpoint(CreateEndpoint()); 786helper.ViewContext.HttpContext.SetEndpoint(CreateEndpoint(importMap)); 882helper.ViewContext.HttpContext.SetEndpoint(CreateEndpoint()); 1012helper.ViewContext.HttpContext.SetEndpoint(CreateEndpoint()); 1051helper.ViewContext.HttpContext.SetEndpoint(CreateEndpoint()); 1052helper.ViewContext.HttpContext.Request.PathBase = "/approot";