100 instantiations of ViewContext
Microsoft.AspNetCore.Mvc.Localization.Test (10)
ViewLocalizerTest.cs (10)
35var viewContext = new ViewContext(); 70var viewContext = new ViewContext(); 102var viewContext = new ViewContext(); 126var viewContext = new ViewContext(); 151var viewContext = new ViewContext(); 177var viewContext = new ViewContext(); 201var viewContext = new ViewContext(); 225var viewContext = new ViewContext(); 249var viewContext = new ViewContext(); 273var viewContext = new ViewContext();
Microsoft.AspNetCore.Mvc.Razor.Test (19)
Compilation\RazorPagePropertyActivatorTest.cs (8)
21var viewContext = new ViewContext(); 40var viewContext = new ViewContext(); 64var viewContext = new ViewContext 93var viewContext = new ViewContext 122var viewContext = new ViewContext 151var viewContext = new ViewContext 180var viewContext = new ViewContext 204var viewContext = new ViewContext
DefaultTagHelperFactoryTest.cs (1)
158var viewContext = new ViewContext(
Infrastructure\DefaultTagHelperActivatorTest.cs (1)
44var viewContext = new ViewContext(
RazorPageActivatorTest.cs (1)
260return new ViewContext(
RazorPageCreateModelExpressionTest.cs (1)
324return new ViewContext(
RazorPageCreateTagHelperTest.cs (1)
95var viewContext = new ViewContext(
RazorPageTest.cs (1)
1428return new ViewContext(
RazorViewTest.cs (1)
1794return new ViewContext(
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.RazorPages (2)
Infrastructure\PageActionInvoker.cs (2)
110_viewContext = new ViewContext( 149_viewContext = new ViewContext(
Microsoft.AspNetCore.Mvc.RazorPages.Test (24)
Infrastructure\DefaultPageActivatorProviderTest.cs (5)
34var viewContext = new ViewContext(); 111var viewContext = new ViewContext(); 132var viewContext = new ViewContext(); 153var viewContext = new ViewContext(); 174var viewContext = new ViewContext();
Infrastructure\DefaultPageFactoryProviderTest.cs (10)
53var viewContext = new ViewContext(); 77var viewContext = new ViewContext(); 120var viewContext = new ViewContext(); 145var viewContext = new ViewContext(); 172var viewContext = new ViewContext(); 197var viewContext = new ViewContext(); 227var viewContext = new ViewContext() 266var viewContext = new ViewContext() 309var viewContext = new ViewContext() 347var viewContext = new ViewContext()
Infrastructure\DefaultPageModelActivatorProviderTest.cs (3)
157var viewContext = new ViewContext(); 178var viewContext = new ViewContext(); 199var viewContext = new ViewContext();
PageTest.cs (6)
33var viewContext = new ViewContext(pageContext, NullView.Instance, viewData, tempData, TextWriter.Null, new HtmlHelperOptions()); 1716ViewContext = new ViewContext 1741ViewContext = new ViewContext 1766ViewContext = new ViewContext 1788ViewContext = new ViewContext 1810ViewContext = new ViewContext
Microsoft.AspNetCore.Mvc.TagHelpers (1)
PartialTagHelper.cs (1)
203var partialViewContext = new ViewContext(ViewContext, view, newViewData, writer);
Microsoft.AspNetCore.Mvc.TagHelpers.Test (23)
CacheTagHelperTest.cs (1)
932return new ViewContext(
CacheTagKeyTest.cs (1)
541return new ViewContext(actionContext,
ComponentTagHelperTest.cs (1)
97return new ViewContext { HttpContext = httpContext };
DefaultTagHelperActivatorTest.cs (1)
66var viewContext = new ViewContext
DistributedCacheTagHelperTest.cs (1)
739return new ViewContext(actionContext,
FormActionTagHelperTest.cs (7)
48var viewContext = new ViewContext(); 123var viewContext = new ViewContext(); 228var viewContext = new ViewContext(); 287var viewContext = new ViewContext(); 359var viewContext = new ViewContext(); 413var viewContext = new ViewContext(); 477var viewContext = new ViewContext
FormTagHelperTest.cs (1)
1161return new ViewContext(
ImageTagHelperTest.cs (1)
301var viewContext = new ViewContext(
LinkTagHelperTest.cs (1)
1132var viewContext = new ViewContext(
PartialTagHelperTest.cs (1)
840return new ViewContext(
PersistComponentStateTagHelperTest.cs (1)
268return new ViewContext { HttpContext = httpContext };
RenderAtEndOfFormTagHelperTest.cs (2)
46var viewContext = new ViewContext(); 87var viewContext = new ViewContext();
ScriptTagHelperTest.cs (1)
1113var viewContext = new ViewContext(
TestableHtmlGenerator.cs (1)
83var viewContext = new ViewContext(
ValidationMessageTagHelperTest.cs (1)
470return new ViewContext(
ValidationSummaryTagHelperTest.cs (1)
654return new ViewContext(
Microsoft.AspNetCore.Mvc.ViewFeatures (8)
HtmlHelper.cs (1)
547var viewContext = new ViewContext(ViewContext, view, newViewData, writer);
TemplateRenderer.cs (2)
122var viewContext = new ViewContext(_viewContext, viewEngineResult.View, _viewData, writer); 244var newViewContext = new ViewContext(viewContext, viewContext.View, viewData, viewContext.Writer);
ViewComponentResultExecutor.cs (1)
102var viewContext = new ViewContext(
ViewComponents\ViewComponentContext.cs (2)
26ViewContext = new ViewContext(); 58ViewContext = new ViewContext(
ViewComponents\ViewViewComponentResult.cs (1)
118var childViewContext = new ViewContext(
ViewExecutor.cs (1)
157var viewContext = new ViewContext(
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (13)
DefaultHtmlGeneratorTest.cs (1)
1039return new ViewContext(
DefaultValidationHtmlAttributeProviderTest.cs (1)
259return new ViewContext(
Rendering\DefaultTemplatesUtilities.cs (1)
288var viewContext = new ViewContext(
Rendering\ViewContextTests.cs (3)
22var context = new ViewContext( 49var originalContext = new ViewContext( 61var context = new ViewContext(originalContext, view, viewData, writer);
ViewComponents\ContentViewComponentResultTest.cs (1)
42var viewContext = new ViewContext(
ViewComponents\DefaultViewComponentActivatorTests.cs (1)
89ViewContext = new ViewContext
ViewComponents\HtmlContentViewComponentResultTest.cs (1)
42var viewContext = new ViewContext(
ViewComponents\ViewComponentContextTest.cs (2)
25var viewContext = new ViewContext( 87var viewContext = new ViewContext(
ViewComponents\ViewViewComponentResultTest.cs (1)
522var viewContext = new ViewContext(
ViewComponentTests.cs (1)
242var viewContext = new ViewContext();
851 references to ViewContext
Identity.ExternalClaims (5)
Pages\Account\Manage\ManageNavPages.cs (5)
22public static string IndexNavClass(ViewContext viewContext) => PageNavClass(viewContext, Index); 24public static string ChangePasswordNavClass(ViewContext viewContext) => PageNavClass(viewContext, ChangePassword); 26public static string ExternalLoginsNavClass(ViewContext viewContext) => PageNavClass(viewContext, ExternalLogins); 28public static string TwoFactorAuthenticationNavClass(ViewContext viewContext) => PageNavClass(viewContext, TwoFactorAuthentication); 30public static string PageNavClass(ViewContext viewContext, string page)
Microsoft.AspNetCore.Identity.UI (36)
Areas\Identity\Pages\V4\Account\Manage\ManageNavPages.cs (18)
66public static string? IndexNavClass(ViewContext viewContext) => PageNavClass(viewContext, Index); 72public static string? EmailNavClass(ViewContext viewContext) => PageNavClass(viewContext, Email); 78public static string? ChangePasswordNavClass(ViewContext viewContext) => PageNavClass(viewContext, ChangePassword); 84public static string? DownloadPersonalDataNavClass(ViewContext viewContext) => PageNavClass(viewContext, DownloadPersonalData); 90public static string? DeletePersonalDataNavClass(ViewContext viewContext) => PageNavClass(viewContext, DeletePersonalData); 96public static string? ExternalLoginsNavClass(ViewContext viewContext) => PageNavClass(viewContext, ExternalLogins); 102public static string? PersonalDataNavClass(ViewContext viewContext) => PageNavClass(viewContext, PersonalData); 108public static string? TwoFactorAuthenticationNavClass(ViewContext viewContext) => PageNavClass(viewContext, TwoFactorAuthentication); 114public static string? PageNavClass(ViewContext viewContext, string page) 125public static string? IndexAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, Index); 131public static string? EmailAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, Email); 137public static string? ChangePasswordAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, ChangePassword); 143public static string? DownloadPersonalDataAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, DownloadPersonalData); 149public static string? DeletePersonalDataAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, DeletePersonalData); 155public static string? ExternalLoginsAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, ExternalLogins); 161public static string? PersonalDataAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, PersonalData); 167public static string? TwoFactorAuthenticationAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, TwoFactorAuthentication); 173public static string? AriaCurrent(ViewContext viewContext, string page)
Areas\Identity\Pages\V5\Account\Manage\ManageNavPages.cs (18)
66public static string? IndexNavClass(ViewContext viewContext) => PageNavClass(viewContext, Index); 72public static string? EmailNavClass(ViewContext viewContext) => PageNavClass(viewContext, Email); 78public static string? ChangePasswordNavClass(ViewContext viewContext) => PageNavClass(viewContext, ChangePassword); 84public static string? DownloadPersonalDataNavClass(ViewContext viewContext) => PageNavClass(viewContext, DownloadPersonalData); 90public static string? DeletePersonalDataNavClass(ViewContext viewContext) => PageNavClass(viewContext, DeletePersonalData); 96public static string? ExternalLoginsNavClass(ViewContext viewContext) => PageNavClass(viewContext, ExternalLogins); 102public static string? PersonalDataNavClass(ViewContext viewContext) => PageNavClass(viewContext, PersonalData); 108public static string? TwoFactorAuthenticationNavClass(ViewContext viewContext) => PageNavClass(viewContext, TwoFactorAuthentication); 114public static string? PageNavClass(ViewContext viewContext, string page) 125public static string? IndexAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, Index); 131public static string? EmailAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, Email); 137public static string? ChangePasswordAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, ChangePassword); 143public static string? DownloadPersonalDataAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, DownloadPersonalData); 149public static string? DeletePersonalDataAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, DeletePersonalData); 155public static string? ExternalLoginsAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, ExternalLogins); 161public static string? PersonalDataAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, PersonalData); 167public static string? TwoFactorAuthenticationAriaCurrent(ViewContext viewContext) => AriaCurrent(viewContext, TwoFactorAuthentication); 173public static string? AriaCurrent(ViewContext viewContext, string page)
Microsoft.AspNetCore.Mvc.Localization (3)
ViewLocalizer.cs (3)
75/// Apply the specified <see cref="ViewContext"/>. 77/// <param name="viewContext">The <see cref="ViewContext"/>.</param> 78public void Contextualize(ViewContext viewContext)
Microsoft.AspNetCore.Mvc.Localization.Test (10)
ViewLocalizerTest.cs (10)
35var viewContext = new ViewContext(); 70var viewContext = new ViewContext(); 102var viewContext = new ViewContext(); 126var viewContext = new ViewContext(); 151var viewContext = new ViewContext(); 177var viewContext = new ViewContext(); 201var viewContext = new ViewContext(); 225var viewContext = new ViewContext(); 249var viewContext = new ViewContext(); 273var viewContext = new ViewContext();
Microsoft.AspNetCore.Mvc.Razor (77)
DefaultTagHelperFactory.cs (9)
20private readonly ConcurrentDictionary<Type, PropertyActivator<ViewContext>[]> _injectActions; 21private readonly Func<Type, PropertyActivator<ViewContext>[]> _getPropertiesToActivate; 22private static readonly Func<PropertyInfo, PropertyActivator<ViewContext>> _createActivateInfo = CreateActivateInfo; 35_injectActions = new ConcurrentDictionary<Type, PropertyActivator<ViewContext>[]>(); 37PropertyActivator<ViewContext>.GetPropertiesToActivate( 49public TTagHelper CreateTagHelper<TTagHelper>(ViewContext context) 71private static void InitializeTagHelper<TTagHelper>(TTagHelper tagHelper, ViewContext context) 84private static PropertyActivator<ViewContext> CreateActivateInfo(PropertyInfo property) 86return new PropertyActivator<ViewContext>(property, viewContext => viewContext);
DependencyInjection\MvcRazorMvcBuilderExtensions.cs (1)
59Action<TTagHelper, ViewContext> initialize)
DependencyInjection\MvcRazorMvcCoreBuilderExtensions.cs (1)
104Action<TTagHelper, ViewContext> initialize)
Diagnostics\MvcDiagnostics.cs (4)
30public BeforeViewPageEventData(IRazorPage page, ViewContext viewContext, ActionDescriptor actionDescriptor, HttpContext httpContext) 46public ViewContext ViewContext { get; } 91public AfterViewPageEventData(IRazorPage page, ViewContext viewContext, ActionDescriptor actionDescriptor, HttpContext httpContext) 107public ViewContext ViewContext { get; }
Infrastructure\DefaultTagHelperActivator.cs (1)
16public TTagHelper Create<TTagHelper>(ViewContext context)
IRazorPage.cs (2)
17ViewContext ViewContext { get; set; } 55/// Renders the page and writes the output to the <see cref="ViewContext.Writer"/>.
IRazorPageActivator.cs (2)
17/// <param name="context">The <see cref="ViewContext"/> for the executing view.</param> 18void Activate(IRazorPage page, ViewContext context);
ITagHelperActivator.cs (2)
18/// <param name="context">The <see cref="ViewContext"/> for the executing view.</param> 20TTagHelper Create<TTagHelper>(ViewContext context) where TTagHelper : ITagHelper;
ITagHelperFactory.cs (2)
17/// <param name="context"><see cref="ViewContext"/> for the executing view.</param> 19TTagHelper CreateTagHelper<TTagHelper>(ViewContext context) where TTagHelper : ITagHelper;
ITagHelperInitializerOfT.cs (2)
20/// <param name="context">The <see cref="ViewContext"/> for the executing view.</param> 21void Initialize(TTagHelper helper, ViewContext context);
MvcRazorDiagnosticListenerExtensions.cs (4)
15ViewContext viewContext) 27ViewContext viewContext) 45ViewContext viewContext) 57ViewContext viewContext)
RazorPage.cs (1)
174var viewContext = ViewContext;
RazorPageActivator.cs (1)
58public void Activate(IRazorPage page, ViewContext context)
RazorPageBase.cs (10)
46public virtual ViewContext ViewContext { get; set; } = default!; 62var viewContext = ViewContext; 215/// All writes to the <see cref="Output"/> or <see cref="ViewContext.Writer"/> after calling this method will 220var viewContext = ViewContext; 263/// All writes to the <see cref="Output"/> or <see cref="ViewContext.Writer"/> after calling this method will 276var viewContext = ViewContext; 325var viewContext = ViewContext; 337var viewContext = ViewContext; 354var viewContext = ViewContext; 713var viewContext = ViewContext;
RazorPagePropertyActivator.cs (12)
22private readonly PropertyActivator<ViewContext>[] _propertyActivators; 38_propertyActivators = PropertyActivator<ViewContext>.GetPropertiesToActivate<RazorInjectAttribute>( 44public void Activate(object page, ViewContext context) 57internal ViewDataDictionary CreateViewDataDictionary(ViewContext context) 75private static PropertyActivator<ViewContext> CreateActivateInfo( 80Func<ViewContext, object> valueAccessor; 134return new PropertyActivator<ViewContext>(property, valueAccessor); 139public Func<ViewContext, object> UrlHelperAccessor { get; init; } = default!; 141public Func<ViewContext, object> JsonHelperAccessor { get; init; } = default!; 143public Func<ViewContext, object> DiagnosticSourceAccessor { get; init; } = default!; 145public Func<ViewContext, object> HtmlEncoderAccessor { get; init; } = default!; 147public Func<ViewContext, object> ModelExpressionProviderAccessor { get; init; } = default!;
RazorView.cs (7)
73internal Action<IRazorPage, ViewContext>? OnAfterPageActivated { get; set; } 76public virtual async Task RenderAsync(ViewContext context) 91ViewContext context, 138private async Task RenderPageCoreAsync(IRazorPage page, ViewContext context) 157private async Task RenderViewStartsAsync(ViewContext context) 195ViewContext context, 269private IRazorPage GetLayoutPage(ViewContext context, string executingFilePath, string layoutPath)
ServiceBasedTagHelperActivator.cs (1)
17public TTagHelper Create<TTagHelper>(ViewContext context) where TTagHelper : ITagHelper
TagHelperInitializerOfT.cs (3)
13private readonly Action<TTagHelper, ViewContext> _initializeDelegate; 19public TagHelperInitializer(Action<TTagHelper, ViewContext> action) 27public void Initialize(TTagHelper helper, ViewContext context)
TagHelpers\ITagHelperComponentPropertyActivator.cs (2)
17/// <param name="context">The <see cref="ViewContext"/> for the executing view.</param> 19void Activate(ViewContext context, ITagHelperComponent tagHelperComponent);
TagHelpers\TagHelperComponentPropertyActivator.cs (8)
18private readonly ConcurrentDictionary<Type, PropertyActivator<ViewContext>[]> _propertiesToActivate = new(); 19private readonly Func<Type, PropertyActivator<ViewContext>[]> _getPropertiesToActivate = GetPropertiesToActivate; 20private static readonly Func<PropertyInfo, PropertyActivator<ViewContext>> _createActivateInfo = CreateActivateInfo; 28public void Activate(ViewContext context, ITagHelperComponent tagHelperComponent) 43private static PropertyActivator<ViewContext> CreateActivateInfo(PropertyInfo property) 45return new PropertyActivator<ViewContext>(property, viewContext => viewContext); 48private static PropertyActivator<ViewContext>[] GetPropertiesToActivate(Type type) 50return PropertyActivator<ViewContext>.GetPropertiesToActivate(
TagHelpers\TagHelperComponentTagHelper.cs (1)
54public ViewContext ViewContext { get; set; } = default!;
TagHelpers\UrlResolutionTagHelper.cs (1)
114public ViewContext ViewContext { get; set; } = default!;
Microsoft.AspNetCore.Mvc.Razor.Test (128)
Compilation\RazorPagePropertyActivatorTest.cs (8)
21var viewContext = new ViewContext(); 40var viewContext = new ViewContext(); 64var viewContext = new ViewContext 93var viewContext = new ViewContext 122var viewContext = new ViewContext 151var viewContext = new ViewContext 180var viewContext = new ViewContext 204var viewContext = new ViewContext
DefaultTagHelperFactoryTest.cs (11)
35var viewContext = MakeViewContext(httpContext); 57var viewContext = MakeViewContext(httpContext); 84var viewContext = MakeViewContext(httpContext); 112var viewContext = MakeViewContext(httpContext); 116.Setup(a => a.Create<TestTagHelper>(It.IsAny<ViewContext>())) 120.Setup(a => a.Create<AnotherTestTagHelper>(It.IsAny<ViewContext>())) 149activator.Setup(a => a.Create<TestTagHelper>(It.IsAny<ViewContext>())).Returns(new TestTagHelper()); 153private static ViewContext MakeViewContext(HttpContext httpContext) 158var viewContext = new ViewContext( 178public ViewContext ViewContext { get; set; } 190public ViewContext ViewContext { get; set; }
Infrastructure\DefaultTagHelperActivatorTest.cs (5)
27var viewContext = MakeViewContext(httpContext); 39private static ViewContext MakeViewContext(HttpContext httpContext) 44var viewContext = new ViewContext( 64public ViewContext ViewContext { get; set; } 76public ViewContext ViewContext { get; set; }
RazorPageActivatorTest.cs (8)
53var viewContext = CreateViewContext(); 89var viewContext = CreateViewContext(viewData); 116var viewContext = CreateViewContext(viewData); 161var viewContext = CreateViewContext(viewData); 179var viewContext = CreateViewContext(viewData); 239private ViewContext CreateViewContext(ViewDataDictionary viewData = null) 339public ViewContext ViewContext { get; private set; } 341public void Contextualize(ViewContext viewContext)
RazorPageCreateModelExpressionTest.cs (15)
23var viewContext = CreateViewContext(); 48var viewContext = CreateViewContext(); 107var viewContext = CreateViewContext(); 133var viewContext = CreateViewContext(); 151var viewContext = CreateViewContext(); 169var viewContext = CreateViewContext(); 187var viewContext = CreateViewContext(); 206var viewContext = CreateViewContext(); 224var viewContext = CreateViewContext(); 242var viewContext = CreateViewContext(); 260var viewContext = CreateViewContext(); 273private static IdentityRazorPage CreateIdentityPage(ViewContext viewContext) 283public static NotQuiteIdentityRazorPage CreateNotQuiteIdentityPage(ViewContext viewContext) 293private static TestRazorPage CreatePage(ViewContext viewContext) 311private static ViewContext CreateViewContext()
RazorPageCreateTagHelperTest.cs (2)
95var viewContext = new ViewContext( 135public ViewContext ViewContext { get; set; }
RazorPageTest.cs (20)
34var viewContext = CreateViewContext(); 62var viewContext = CreateViewContext(); 86var viewContext = CreateViewContext(); 121var viewContext = CreateViewContext(); 176var viewContext = CreateViewContext(); 191var viewContext = CreateViewContext(); 232var viewContext = CreateViewContext(); 253var viewContext = CreateViewContext(); 273var viewContext = CreateViewContext(bufferScope: bufferScope); 402var viewContext = CreateViewContext(); 419var viewContext = CreateViewContext(); 458var context = CreateViewContext(viewPath: "/Views/TestPath/Test.cshtml"); 480var context = CreateViewContext(viewPath: "/Views/TestPath/Test.cshtml"); 867var context = CreateViewContext(writer.Object); 887var context = CreateViewContext(writer.Object); 905var context = CreateViewContext(writer.Object); 930var context = CreateViewContext(writer.Object); 1377ViewContext context = null) 1388ViewContext context = null) 1405private static ViewContext CreateViewContext(
RazorViewTest.cs (51)
45var viewContext = CreateViewContext(view); 76var viewContext = CreateViewContext(view); 79.Setup(a => a.Activate(page, It.IsAny<ViewContext>())) 80.Callback((IRazorPage p, ViewContext c) => 119var viewContext = CreateViewContext(view); 122.Setup(a => a.Activate(page, It.IsAny<ViewContext>())) 123.Callback((IRazorPage p, ViewContext c) => 195var viewContext = CreateViewContext(view); 212.Setup(a => a.Activate(page, It.IsAny<ViewContext>())) 221var viewContext = CreateViewContext(view); 270var viewContext = CreateViewContext(view); 295var viewContext = CreateViewContext(view); 321var viewContext = CreateViewContext(view); 341.Setup(a => a.Activate(page, It.IsAny<ViewContext>())) 350var viewContext = CreateViewContext(view); 382.Setup(a => a.Activate(viewStart1, It.IsAny<ViewContext>())) 385.Setup(a => a.Activate(viewStart2, It.IsAny<ViewContext>())) 388.Setup(a => a.Activate(page, It.IsAny<ViewContext>())) 406var viewContext = CreateViewContext(view); 450var context = CreateViewContext(view); 504var context = CreateViewContext(view); 538var viewContext = CreateViewContext(view); 581var viewContext = CreateViewContext(view); 626var viewContext = CreateViewContext(view); 684.Setup(a => a.Activate(page, It.IsAny<ViewContext>())) 687.Setup(a => a.Activate(layout, It.IsAny<ViewContext>())) 702var viewContext = CreateViewContext(view); 743var viewContext = CreateViewContext(view); 810var viewContext = CreateViewContext(view); 879var viewContext = CreateViewContext(view); 942var viewContext = CreateViewContext(view); 1011var viewContext = CreateViewContext(view); 1046var viewContext = CreateViewContext(view); 1114var viewContext = CreateViewContext(view); 1188var viewContext = CreateViewContext(view); 1229var viewContext = CreateViewContext(view); 1283var viewContext = CreateViewContext(view); 1353var viewContext = CreateViewContext(view); 1411var viewContext = CreateViewContext(view); 1466var viewContext = CreateViewContext(view); 1497var viewContext = CreateViewContext(view); 1544var viewContext = CreateViewContext(view); 1589var viewContext = CreateViewContext(view); 1647var viewContext = CreateViewContext(view); 1692var viewContext = CreateViewContext(view); 1734var viewContext = CreateViewContext(view); 1755pageActivator.Setup(p => p.Activate(It.IsAny<IRazorPage>(), It.IsAny<ViewContext>())) 1756.Callback((IRazorPage p, ViewContext v) => activated.Add(p)); 1772var viewContext = CreateViewContext(view); 1778void AssertActivated(IRazorPage p, ViewContext v) 1786private static ViewContext CreateViewContext(RazorView view)
TagHelpers\TagHelperComponentPropertyActivatorTest.cs (5)
20var viewContext = CreateViewContext(); 36public ViewContext ViewContext { get; set; } 48private static ViewContext CreateViewContext() 57var viewContext = Mock.Of<ViewContext>(vc => vc.HttpContext == httpContext);
TagHelpers\TagHelperComponentTagHelperTest.cs (3)
386private static ViewContext CreateViewContext() 395var viewContext = Mock.Of<ViewContext>(vc => vc.HttpContext == httpContext);
Microsoft.AspNetCore.Mvc.RazorPages (29)
Infrastructure\DefaultPageActivatorProvider.cs (12)
15private readonly Action<PageContext, ViewContext, object> _disposer = Dispose; 16private readonly Func<PageContext, ViewContext, object, ValueTask> _asyncDisposer = AsyncDispose; 17private readonly Func<PageContext, ViewContext, object, ValueTask> _syncAsyncDisposer = SyncAsyncDispose; 20public Func<PageContext, ViewContext, object> CreateActivator(CompiledPageActionDescriptor actionDescriptor) 36public Action<PageContext, ViewContext, object>? CreateReleaser(CompiledPageActionDescriptor actionDescriptor) 48public Func<PageContext, ViewContext, object, ValueTask>? CreateAsyncReleaser(CompiledPageActionDescriptor actionDescriptor) 65private static Func<PageContext, ViewContext, object> CreatePageFactory(Type pageTypeInfo) 68var parameter2 = Expression.Parameter(typeof(ViewContext), "viewContext"); 75.Lambda<Func<PageContext, ViewContext, object>>(newExpression, parameter1, parameter2) 80private static void Dispose(PageContext context, ViewContext viewContext, object page) 89private static ValueTask SyncAsyncDispose(PageContext context, ViewContext viewContext, object page) 95private static ValueTask AsyncDispose(PageContext context, ViewContext viewContext, object page)
Infrastructure\DefaultPageFactoryProvider.cs (3)
42public Func<PageContext, ViewContext, object> CreatePageFactory(CompiledPageActionDescriptor actionDescriptor) 70public Action<PageContext, ViewContext, object>? CreatePageDisposer(CompiledPageActionDescriptor descriptor) 77public Func<PageContext, ViewContext, object, ValueTask>? CreateAsyncPageDisposer(CompiledPageActionDescriptor descriptor)
Infrastructure\PageActionInvoker.cs (1)
28private ViewContext? _viewContext;
Infrastructure\PageActionInvokerCacheEntry.cs (4)
17Func<PageContext, ViewContext, object> pageFactory, 18Func<PageContext, ViewContext, object, ValueTask>? releasePage, 42public Func<PageContext, ViewContext, object> PageFactory { get; } 47public Func<PageContext, ViewContext, object, ValueTask>? ReleasePage { get; }
Infrastructure\PageResultExecutor.cs (1)
69var viewContext = result.Page.ViewContext;
Infrastructure\RazorPageAdapter.cs (1)
32public ViewContext ViewContext
IPageActivatorProvider.cs (3)
18Func<PageContext, ViewContext, object> CreateActivator(CompiledPageActionDescriptor descriptor); 25Action<PageContext, ViewContext, object>? CreateReleaser(CompiledPageActionDescriptor descriptor); 32Func<PageContext, ViewContext, object, ValueTask>? CreateAsyncReleaser(CompiledPageActionDescriptor descriptor)
IPageFactoryProvider.cs (3)
18Func<PageContext, ViewContext, object> CreatePageFactory(CompiledPageActionDescriptor descriptor); 25Action<PageContext, ViewContext, object>? CreatePageDisposer(CompiledPageActionDescriptor descriptor); 32Func<PageContext, ViewContext, object, ValueTask>? CreateAsyncPageDisposer(CompiledPageActionDescriptor descriptor)
PageBase.cs (1)
37public override ViewContext ViewContext { get; set; } = default!;
Microsoft.AspNetCore.Mvc.RazorPages.Test (24)
Infrastructure\DefaultPageActivatorProviderTest.cs (5)
34var viewContext = new ViewContext(); 111var viewContext = new ViewContext(); 132var viewContext = new ViewContext(); 153var viewContext = new ViewContext(); 174var viewContext = new ViewContext();
Infrastructure\DefaultPageFactoryProviderTest.cs (10)
53var viewContext = new ViewContext(); 77var viewContext = new ViewContext(); 120var viewContext = new ViewContext(); 145var viewContext = new ViewContext(); 172var viewContext = new ViewContext(); 197var viewContext = new ViewContext(); 227var viewContext = new ViewContext() 266var viewContext = new ViewContext() 309var viewContext = new ViewContext() 347var viewContext = new ViewContext()
Infrastructure\DefaultPageModelActivatorProviderTest.cs (3)
157var viewContext = new ViewContext(); 178var viewContext = new ViewContext(); 199var viewContext = new ViewContext();
Infrastructure\PageActionInvokerProviderTest.cs (4)
36Func<PageContext, ViewContext, object> factory = (a, b) => null; 37Func<PageContext, ViewContext, object, ValueTask> releaser = (a, b, c) => default; 88Func<PageContext, ViewContext, object> factory = (a, b) => null; 89Func<PageContext, ViewContext, object, ValueTask> releaser = (a, b, c) => default;
Infrastructure\PageActionInvokerTest.cs (1)
1521object pageFactory(PageContext context, ViewContext viewContext)
PageTest.cs (1)
33var viewContext = new ViewContext(pageContext, NullView.Instance, viewData, tempData, TextWriter.Null, new HtmlHelperOptions());
Microsoft.AspNetCore.Mvc.TagHelpers (31)
AnchorTagHelper.cs (2)
155/// Gets or sets the <see cref="Rendering.ViewContext"/> for the current request. 159public ViewContext ViewContext { get; set; }
CacheTagHelperBase.cs (1)
58public ViewContext ViewContext { get; set; }
ComponentTagHelper.cs (2)
29/// Gets or sets the <see cref="Rendering.ViewContext"/> for the current request. 33public ViewContext ViewContext { get; set; }
FormActionTagHelper.cs (2)
93/// Gets or sets the <see cref="Rendering.ViewContext"/> for the current request. 97public ViewContext ViewContext { get; set; }
FormTagHelper.cs (2)
47/// Gets the <see cref="Rendering.ViewContext"/> of the executing view. 51public ViewContext ViewContext { get; set; }
InputTagHelper.cs (2)
83/// Gets the <see cref="Rendering.ViewContext"/> of the executing view. 87public ViewContext ViewContext { get; set; }
LabelTagHelper.cs (2)
31/// Gets the <see cref="Rendering.ViewContext"/> of the executing view. 35public ViewContext ViewContext { get; set; }
OptionTagHelper.cs (2)
38/// Gets the <see cref="Rendering.ViewContext"/> of the executing view. 42public ViewContext ViewContext { get; set; }
PartialTagHelper.cs (3)
97/// Gets the <see cref="Rendering.ViewContext"/> of the executing view. 101public ViewContext ViewContext { get; set; } 203var partialViewContext = new ViewContext(ViewContext, view, newViewData, writer);
PersistComponentStateTagHelper.cs (2)
24/// Gets or sets the <see cref="Rendering.ViewContext"/> for the current request. 28public ViewContext ViewContext { get; set; }
RenderAtEndOfFormTagHelper.cs (2)
25/// Gets the <see cref="Rendering.ViewContext"/> of the executing view. 29public ViewContext ViewContext { get; set; }
ResourceCollectionUtilities.cs (1)
12internal static bool TryResolveFromAssetCollection(ViewContext viewContext, string url, out string resolvedUrl)
SelectTagHelper.cs (2)
44/// Gets the <see cref="Rendering.ViewContext"/> of the executing view. 48public ViewContext ViewContext { get; set; }
TextAreaTagHelper.cs (2)
36/// Gets the <see cref="Rendering.ViewContext"/> of the executing view. 40public ViewContext ViewContext { get; set; }
ValidationMessageTagHelper.cs (2)
33/// Gets the <see cref="Rendering.ViewContext"/> of the executing view. 37public ViewContext ViewContext { get; set; }
ValidationSummaryTagHelper.cs (2)
33/// Gets the <see cref="Rendering.ViewContext"/> of the executing view. 37public ViewContext ViewContext { get; set; }
Microsoft.AspNetCore.Mvc.TagHelpers.Test (171)
AnchorTagHelperTest.cs (9)
56var viewContext = TestableHtmlGenerator.GetViewContext( 111It.IsAny<ViewContext>(), 161It.IsAny<ViewContext>(), 215It.IsAny<ViewContext>(), 273It.IsAny<ViewContext>(), 332It.IsAny<ViewContext>(), 388It.IsAny<ViewContext>(), 439It.IsAny<ViewContext>(), 448.Callback((ViewContext v, string linkText, string pageName, string pageHandler, string protocol, string hostname, string fragment, object routeValues, object htmlAttributes) =>
CacheTagHelperTest.cs (1)
929private static ViewContext GetViewContext()
CacheTagKeyTest.cs (1)
538private static ViewContext GetViewContext()
ComponentTagHelperTest.cs (2)
25var viewContext = GetViewContext(); 78private ViewContext GetViewContext()
DefaultTagHelperActivatorTest.cs (4)
31var viewContext = CreateViewContext(); 45var viewContext = CreateViewContext(); 54private ViewContext CreateViewContext() 66var viewContext = new ViewContext
DistributedCacheTagHelperTest.cs (1)
736private static ViewContext GetViewContext()
FormActionTagHelperTest.cs (7)
48var viewContext = new ViewContext(); 123var viewContext = new ViewContext(); 228var viewContext = new ViewContext(); 287var viewContext = new ViewContext(); 359var viewContext = new ViewContext(); 413var viewContext = new ViewContext(); 477var viewContext = new ViewContext
FormTagHelperTest.cs (23)
25var viewContext = CreateViewContext(); 96var viewContext = TestableHtmlGenerator.GetViewContext( 150var viewContext = TestableHtmlGenerator.GetViewContext( 210var viewContext = TestableHtmlGenerator.GetViewContext( 268var viewContext = TestableHtmlGenerator.GetViewContext( 332var viewContext = TestableHtmlGenerator.GetViewContext( 382var viewContext = CreateViewContext(); 401It.IsAny<ViewContext>(), 436var testViewContext = CreateViewContext(); 458It.IsAny<ViewContext>(), 464.Callback<ViewContext, string, string, object, string, object>( 508var viewContext = CreateViewContext(); 594var viewContext = TestableHtmlGenerator.GetViewContext( 627var viewContext = CreateViewContext(); 684var viewContext = CreateViewContext(); 741var viewContext = CreateViewContext(); 799var viewContext = CreateViewContext(); 854var viewContext = CreateViewContext(); 900var viewContext = CreateViewContext(); 926.Callback((ViewContext _, string pageName, string pageHandler, object routeValues, string fragment, string method, object htmlAttributes) => 963var viewContext = CreateViewContext(); 966generator.Setup(mock => mock.GenerateAntiforgery(It.IsAny<ViewContext>())) 1154private static ViewContext CreateViewContext()
ImageTagHelperTest.cs (7)
147var viewContext = MakeViewContext(); 183var viewContext = MakeViewContext(); 243var viewContext = MakeViewContext(); 275var viewContext = MakeViewContext("/bar"); 291private static ViewContext MakeViewContext(string requestPathBase = null) 301var viewContext = new ViewContext( 315ViewContext viewContext = null)
InputTagHelperTest.cs (13)
266var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider); 309var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider); 361var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider); 417var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider); 473var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider); 522var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider); 848var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator.Object, metadataProvider); 923var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider); 982var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider); 1042var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider); 1102var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider); 1344var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider); 2407var viewContext = TestableHtmlGenerator.GetViewContext(container, htmlGenerator, metadataProvider);
LabelTagHelperTest.cs (2)
211var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider); 290var viewContext = TestableHtmlGenerator.GetViewContext(
LinkTagHelperTest.cs (4)
819var viewContext = MakeViewContext("/bar"); 1101ViewContext viewContext = null) 1122private static ViewContext MakeViewContext(string requestPathBase = null) 1132var viewContext = new ViewContext(
OptionTagHelperTest.cs (2)
421var viewContext = TestableHtmlGenerator.GetViewContext( 493var viewContext = TestableHtmlGenerator.GetViewContext(
PartialTagHelperTest.cs (47)
90var viewContext = GetViewContext(); 156var viewContext = GetViewContext(); 159view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 160.Callback((ViewContext v) => 194var viewContext = GetViewContext(); 197view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 198.Callback((ViewContext v) => 234var viewContext = GetViewContext(); 238view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 239.Callback((ViewContext v) => 278var viewContext = GetViewContext(); 282view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 283.Callback((ViewContext v) => 325var viewContext = GetViewContext(); 329view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 330.Callback((ViewContext v) => 372var viewContext = GetViewContext(); 376view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 377.Callback((ViewContext v) => 419var viewContext = GetViewContext(); 423view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 424.Callback((ViewContext v) => 459var viewContext = GetViewContext(); 463view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 464.Callback((ViewContext v) => 498var viewContext = GetViewContext(); 503view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 504.Callback((ViewContext v) => 536var viewContext = GetViewContext(); 542view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 579var viewContext = GetViewContext(); 613var viewContext = GetViewContext(); 616view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 617.Callback((ViewContext v) => 655var viewContext = GetViewContext(); 658view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 659.Callback((ViewContext v) => 666fallbackView.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 667.Callback((ViewContext v) => 716var viewContext = GetViewContext(); 757var viewContext = GetViewContext(); 760view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 761.Callback((ViewContext v) => 801var viewContext = GetViewContext(); 804view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 805.Callback((ViewContext v) => 838private static ViewContext GetViewContext()
PersistComponentStateTagHelperTest.cs (1)
255private ViewContext GetViewContext()
RenderAtEndOfFormTagHelperTest.cs (2)
46var viewContext = new ViewContext(); 87var viewContext = new ViewContext();
ScriptTagHelperTest.cs (5)
479var viewContext = MakeViewContext(); 822var viewContext = MakeViewContext("/bar"); 1069ViewContext viewContext = null) 1103private static ViewContext MakeViewContext(string requestPathBase = null) 1113var viewContext = new ViewContext(
SelectTagHelperTest.cs (9)
227var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider); 317var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider); 403var viewContext = TestableHtmlGenerator.GetViewContext( 497var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider); 577var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator.Object, metadataProvider); 659var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator.Object, metadataProvider); 716var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider); 748var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider); 794var viewContext = TestableHtmlGenerator.GetViewContext(
TestableHtmlGenerator.cs (5)
60public static ViewContext GetViewContext( 68public static ViewContext GetViewContext( 83var viewContext = new ViewContext( 94public override IHtmlContent GenerateAntiforgery(ViewContext viewContext) 111ViewContext viewContext,
TextAreaTagHelperTest.cs (3)
144var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider); 171var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider); 204var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider);
ValidationMessageTagHelperTest.cs (10)
63var viewContext = TestableHtmlGenerator.GetViewContext( 100var viewContext = TestableHtmlGenerator.GetViewContext( 142var viewContext = TestableHtmlGenerator.GetViewContext( 237var expectedViewContext = CreateViewContext(); 308It.IsAny<ViewContext>(), 338var viewContext = CreateViewContext(); 371It.IsAny<ViewContext>(), 400var viewContext = CreateViewContext(); 441var viewContext = CreateViewContext(); 463private static ViewContext CreateViewContext()
ValidationSummaryTagHelperTest.cs (13)
75var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider, modelState); 103var viewContext = CreateViewContext(); 171var viewContext = CreateViewContext(); 243var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider); 313var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider); 343var expectedViewContext = CreateViewContext(); 405It.IsAny<ViewContext>(), 428var viewContext = CreateViewContext(); 487var viewContext = CreateViewContext(); 519It.IsAny<ViewContext>(), 543var viewContext = CreateViewContext(); 629var viewContext = TestableHtmlGenerator.GetViewContext(model, htmlGenerator, metadataProvider); 647private static ViewContext CreateViewContext()
Microsoft.AspNetCore.Mvc.ViewFeatures (193)
DefaultHtmlGenerator.cs (31)
126ViewContext viewContext, 146ViewContext viewContext, 165public virtual IHtmlContent GenerateAntiforgery(ViewContext viewContext) 188ViewContext viewContext, 234ViewContext viewContext, 256ViewContext viewContext, 295ViewContext viewContext, 313ViewContext viewContext, 329ViewContext viewContext, 361ViewContext viewContext, 399ViewContext viewContext, 424ViewContext viewContext, 487ViewContext viewContext, 506ViewContext viewContext, 530ViewContext viewContext, 597ViewContext viewContext, 685ViewContext viewContext, 711ViewContext viewContext, 802ViewContext viewContext, 901ViewContext viewContext, 1028internal static string EvalString(ViewContext viewContext, string key, string format) 1064internal static object GetModelStateValue(ViewContext viewContext, string key, Type destinationType) 1077/// <param name="viewContext">A <see cref="ViewContext"/> instance for the current scope.</param> 1088ViewContext viewContext, 1117/// <param name="viewContext">The <see cref="ViewContext"/>.</param> 1130ViewContext viewContext, 1361/// <param name="viewContext">A <see cref="ViewContext"/> instance for the current scope.</param> 1366ViewContext viewContext, 1408private static bool EvalBoolean(ViewContext viewContext, string key) 1413private static string EvalString(ViewContext viewContext, string key) 1486ViewContext viewContext,
DefaultHtmlGeneratorExtensions.cs (4)
17/// <param name="viewContext">The <see cref="ViewContext"/>.</param> 27ViewContext viewContext, 50/// <param name="viewContext">The <see cref="ViewContext"/>.</param> 59ViewContext viewContext,
DefaultValidationHtmlAttributeProvider.cs (1)
45ViewContext viewContext,
Diagnostics\MvcDiagnostics.cs (4)
237public BeforeViewEventData(IView view, ViewContext viewContext) 251public ViewContext ViewContext { get; } 280public AfterViewEventData(IView view, ViewContext viewContext) 294public ViewContext ViewContext { get; }
HtmlHelper.cs (6)
56private ViewContext _viewContext; 95public ViewContext ViewContext 181public virtual void Contextualize(ViewContext viewContext) 547var viewContext = new ViewContext(ViewContext, view, newViewData, writer); 894/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 952/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>.
HtmlHelperOfT.cs (2)
48public override void Contextualize(ViewContext viewContext) 56typeof(ViewContext)),
HtmlHelperOptions.cs (1)
9/// Provides programmatic configuration for the HTML helpers and <see cref="ViewContext"/>.
IHtmlGenerator.cs (40)
44/// <param name="viewContext">The <see cref="ViewContext"/> instance for the current scope.</param> 65ViewContext viewContext, 78/// <param name="viewContext">The <see cref="ViewContext"/> instance for the current scope.</param> 99ViewContext viewContext, 112/// <param name="viewContext">The <see cref="ViewContext"/> instance for the current scope.</param> 117IHtmlContent GenerateAntiforgery(ViewContext viewContext); 122/// <param name="viewContext">The <see cref="ViewContext"/> instance for the current scope.</param> 134ViewContext viewContext, 146ViewContext viewContext, 154/// <param name="viewContext">A <see cref="ViewContext"/> instance for the current scope.</param> 172ViewContext viewContext, 183/// <param name="viewContext">A <see cref="ViewContext"/> instance for the current scope.</param> 202ViewContext viewContext, 214/// <param name="viewContext">A <see cref="ViewContext"/> instance for the current scope.</param> 231ViewContext viewContext, 240/// <param name="viewContext">A <see cref="ViewContext"/> instance for the current scope.</param> 253ViewContext viewContext, 263/// <param name="viewContext">A <see cref="ViewContext"/> instance for the current scope.</param> 275ViewContext viewContext, 284/// <param name="viewContext">A <see cref="ViewContext"/> instance for the current scope.</param> 296ViewContext viewContext, 305/// <param name="viewContext">A <see cref="ViewContext"/> instance for the current scope.</param> 318ViewContext viewContext, 328/// <param name="viewContext">The <see cref="ViewContext"/> instance for the current scope.</param> 348ViewContext viewContext, 360/// <param name="viewContext">A <see cref="ViewContext"/> instance for the current scope.</param> 392ViewContext viewContext, 403/// <param name="viewContext">A <see cref="ViewContext"/> instance for the current scope.</param> 441ViewContext viewContext, 466/// <param name="viewContext">A <see cref="ViewContext"/> instance for the current scope.</param> 479ViewContext viewContext, 489/// <param name="viewContext">A <see cref="ViewContext"/> instance for the current scope.</param> 502ViewContext viewContext, 513/// <param name="viewContext">A <see cref="ViewContext"/> instance for the current scope.</param> 523/// <see cref="ViewContext.ValidationMessageElement"/>. 530/// <remarks><see cref="ViewContext.ValidationMessageElement"/> is <c>"span"</c> by default.</remarks> 532ViewContext viewContext, 554ViewContext viewContext, 563/// <param name="viewContext">A <see cref="ViewContext"/> instance for the current scope.</param> 595ViewContext viewContext,
IViewContextAware.cs (3)
9/// Contract for contextualizing a property activated by a view with the <see cref="ViewContext"/>. 17/// <param name="viewContext">The <see cref="ViewContext"/>.</param> 18void Contextualize(ViewContext viewContext);
MvcViewFeaturesDiagnosticListenerExtensions.cs (4)
123ViewContext viewContext) 132private static void BeforeViewImpl(DiagnosticListener diagnosticListener, IView view, ViewContext viewContext) 145ViewContext viewContext) 154private static void AfterViewImpl(DiagnosticListener diagnosticListener, IView view, ViewContext viewContext)
MvcViewOptions.cs (1)
23/// Gets or sets programmatic configuration for the HTML helpers and <see cref="Rendering.ViewContext"/>.
NameAndIdProvider.cs (6)
18/// <param name="viewContext">A <see cref="ViewContext"/> instance for the current scope.</param> 32public static string CreateSanitizedId(ViewContext viewContext, string fullName, string invalidCharReplacement) 78/// <param name="viewContext">A <see cref="ViewContext"/> instance for the current scope.</param> 92ViewContext viewContext, 122/// <param name="viewContext">A <see cref="ViewContext"/> instance for the current scope.</param> 128public static string GetFullHtmlFieldName(ViewContext viewContext, string expression)
NullView.cs (1)
15public Task RenderAsync(ViewContext context)
Rendering\HtmlHelperFormExtensions.cs (19)
20/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 50/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 76/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 106/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 145/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 180/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 206/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 242/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 273/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 311/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 348/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 384/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 419/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 443/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 472/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 503/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 531/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 566/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 600/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>.
Rendering\HtmlHelperPartialExtensions.cs (7)
180/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 196/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 215/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 232/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 256/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 278/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 301/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>.
Rendering\HtmlHelperValidationExtensions.cs (19)
21/// A new <see cref="IHtmlContent"/> containing a <see cref="ViewContext.ValidationMessageElement"/> element. 50/// A new <see cref="IHtmlContent"/> containing a <see cref="ViewContext.ValidationMessageElement"/> element. 72/// (<see cref="ViewContext.ValidationMessageElement"/>) element. Alternatively, an 77/// A new <see cref="IHtmlContent"/> containing a <see cref="ViewContext.ValidationMessageElement"/> element. 108/// <see cref="ViewContext.ValidationMessageElement"/>. 139/// (<see cref="ViewContext.ValidationMessageElement"/>) element. Alternatively, an 144/// A new <see cref="IHtmlContent"/> containing a <see cref="ViewContext.ValidationMessageElement"/> element. 168/// A new <see cref="IHtmlContent"/> containing a <see cref="ViewContext.ValidationMessageElement"/> element. 200/// A new <see cref="IHtmlContent"/> containing a <see cref="ViewContext.ValidationMessageElement"/> element. 228/// (<see cref="ViewContext.ValidationMessageElement"/>) element. Alternatively, an 235/// A new <see cref="IHtmlContent"/> containing a <see cref="ViewContext.ValidationMessageElement"/> element. 264/// <see cref="ViewContext.ValidationMessageElement"/>. 336/// <see cref="ViewContext.ValidationSummaryMessageElement" /> element (which wraps the 359/// <see cref="ViewContext.ValidationSummaryMessageElement" />. 388/// <see cref="ViewContext.ValidationSummaryMessageElement" /> element (which, in turn, wraps the 419/// <see cref="ViewContext.ValidationSummaryMessageElement" /> element (which wraps the 450/// <see cref="ViewContext.ValidationSummaryMessageElement" />. 483/// <see cref="ViewContext.ValidationSummaryMessageElement" />. 521/// <see cref="ViewContext.ValidationSummaryMessageElement" /> element (which wraps the
Rendering\IHtmlHelper.cs (7)
41ViewContext ViewContext { get; } 122/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 158/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 340/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 578/// In this context, "renders" means the method writes its output using <see cref="ViewContext.Writer"/>. 679/// <see cref="ViewContext.ValidationMessageElement"/>. 702/// <see cref="ViewContext.ValidationSummaryMessageElement" />.
Rendering\IHtmlHelperOfT.cs (1)
409/// <see cref="ViewContext.ValidationMessageElement"/>.
Rendering\MvcForm.cs (3)
15private readonly ViewContext _viewContext; 23/// <param name="viewContext">The <see cref="ViewContext"/>.</param> 25public MvcForm(ViewContext viewContext, HtmlEncoder htmlEncoder)
Rendering\ViewContext.cs (5)
24/// Creates an empty <see cref="ViewContext"/>. 39/// Initializes a new instance of <see cref="ViewContext"/>. 78/// Initializes a new instance of <see cref="ViewContext"/>. 80/// <param name="viewContext">The <see cref="ViewContext"/> to copy values from.</param> 85ViewContext viewContext,
TemplateBuilder.cs (2)
18private readonly ViewContext _viewContext; 31ViewContext viewContext,
TemplateRenderer.cs (5)
73private readonly ViewContext _viewContext; 81ViewContext viewContext, 122var viewContext = new ViewContext(_viewContext, viewEngineResult.View, _viewData, writer); 238private static IHtmlHelper MakeHtmlHelper(ViewContext viewContext, ViewDataDictionary viewData) 244var newViewContext = new ViewContext(viewContext, viewContext.View, viewData, viewContext.Writer);
ValidationHtmlAttributeProvider.cs (4)
17/// <param name="viewContext">A <see cref="ViewContext"/> instance for the current scope.</param> 28ViewContext viewContext, 37/// <param name="viewContext">A <see cref="ViewContext"/> instance for the current scope.</param> 51ViewContext viewContext,
ViewComponent.cs (1)
129public ViewContext ViewContext => ViewComponentContext.ViewContext;
ViewComponentResultExecutor.cs (2)
102var viewContext = new ViewContext( 136private static void OnExecuting(ViewContext viewContext)
ViewComponents\DefaultViewComponentHelper.cs (2)
26private ViewContext _viewContext = default!; 59public void Contextualize(ViewContext viewContext)
ViewComponents\ViewComponentContext.cs (3)
43ViewContext viewContext, 90/// Gets or sets the <see cref="Rendering.ViewContext"/>. 95public ViewContext ViewContext { get; set; }
ViewComponents\ViewViewComponentResult.cs (2)
73var viewContext = context.ViewContext; 118var childViewContext = new ViewContext(
ViewContextAttribute.cs (1)
8/// <see cref="Rendering.ViewContext"/> when creating the tag helper. The property must have a
ViewEngines\IView.cs (2)
23/// <param name="context">The <see cref="ViewContext"/>.</param> 25Task RenderAsync(ViewContext context);
ViewExecutor.cs (4)
157var viewContext = new ViewContext( 171/// <param name="viewContext">The <see cref="ViewContext"/> associated with the current request.</param> 181ViewContext viewContext, 233private static void OnExecuting(ViewContext viewContext)
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (139)
DefaultDisplayTemplatesTest.cs (1)
350view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>()))
DefaultEditorTemplatesTest.cs (3)
1298view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 1384public ViewContext ViewContext 1404public void Contextualize(ViewContext viewContext)
DefaultHtmlGeneratorTest.cs (32)
32var viewContext = GetViewContext<Model>(model: null, metadataProvider: metadataProvider); 53var viewContext = GetViewContext<Model>(model: null, metadataProvider: metadataProvider); 73var viewContext = GetViewContext<Model>(model: null, metadataProvider: metadataProvider); 86var viewContext = GetViewContext<Model>(model: null, metadataProvider: metadataProvider); 114var viewContext = GetViewContext<Model>(model: null, metadataProvider: metadataProvider); 142var viewContext = GetViewContext<Model>(model: null, metadataProvider: metadataProvider); 169var viewContext = GetViewContext<Model>(model: null, metadataProvider: metadataProvider); 198var viewContext = GetViewContext<ModelWithMaxLengthMetadata>(model: null, metadataProvider: metadataProvider); 222var viewContext = GetViewContext<ModelWithMaxLengthMetadata>(model: null, metadataProvider: metadataProvider); 246var viewContext = GetViewContext<ModelWithMaxLengthMetadata>(model: null, metadataProvider: metadataProvider); 268var viewContext = GetViewContext<ModelWithMaxLengthMetadata>(model: null, metadataProvider: metadataProvider); 290var viewContext = GetViewContext<ModelWithMaxLengthMetadata>(model: null, metadataProvider: metadataProvider); 313var viewContext = GetViewContext<ModelWithMaxLengthMetadata>(model: null, metadataProvider: metadataProvider); 365var viewContext = GetViewContext<Model>(model: null, metadataProvider, htmlHelperOptions); 395var viewContext = GetViewContext<Model>(model: null, metadataProvider, htmlHelperOptions); 421var viewContext = GetViewContext<ModelWithMaxLengthMetadata>(model: null, metadataProvider: metadataProvider); 442var viewContext = GetViewContext<Model>(model: null, metadataProvider: metadataProvider); 469var viewContext = GetViewContext<Model>(model: null, metadataProvider: metadataProvider); 498var viewContext = GetViewContext<Model>(model: null, metadataProvider: metadataProvider); 521var viewContext = GetViewContext<Model>(model: null, metadataProvider: metadataProvider); 588var viewContext = GetViewContext<Model>(model, metadataProvider); 616var viewContext = GetViewContext<Model>(model, metadataProvider); 664var viewContext = GetViewContext<Model>(model, metadataProvider); 692var viewContext = GetViewContext<Model>(model, metadataProvider); 716var viewContext = GetViewContext<Model>(model, metadataProvider); 770var viewContext = GetViewContext<Model>(model, metadataProvider); 799var viewContext = GetViewContext<Model>(model, metadataProvider); 826var viewContext = GetViewContext<Model>(model, metadataProvider); 938var viewContext = GetViewContext<Model>(model: null, metadataProvider: metadataProvider); 965var viewContext = GetViewContext<Model>(model: null, metadataProvider: metadataProvider); 990var viewContext = GetViewContext<Model>(model: null, metadataProvider: metadataProvider); 1031private static ViewContext GetViewContext<TModel>(TModel model, IModelMetadataProvider metadataProvider, HtmlHelperOptions options = default)
DefaultValidationHtmlAttributeProviderTest.cs (12)
28var viewContext = GetViewContext<Model>(model: null, metadataProvider: metadataProvider); 63var viewContext = GetViewContext<Model>(model: null, metadataProvider: metadataProvider); 97var viewContext = GetViewContext<Model>(model: null, metadataProvider: metadataProvider); 120var viewContext = GetViewContext<Model>(model: null, metadataProvider: metadataProvider); 131It.IsAny<ViewContext>(), 148It.IsAny<ViewContext>(), 161var viewContext = GetViewContext<Model>(model: null, metadataProvider: metadataProvider); 195var viewContext = GetViewContext<Model>(model: null, metadataProvider: metadataProvider); 206It.IsAny<ViewContext>(), 223It.IsAny<ViewContext>(), 235var viewContext = GetViewContext<Model>(model: null, metadataProvider: metadataProvider); 251private static ViewContext GetViewContext<TModel>(TModel model, IModelMetadataProvider metadataProvider)
PartialViewResultTest.cs (1)
185.Setup(v => v.RenderAsync(It.IsAny<ViewContext>()))
Rendering\DefaultTemplatesUtilities.cs (3)
288var viewContext = new ViewContext( 307.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 308.Callback(async (ViewContext v) =>
Rendering\HtmlHelperDisplayExtensionsTest.cs (26)
51view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 52.Callback((ViewContext v) => v.Writer.WriteAsync(v.ViewData["SomeProperty"].ToString())) 134view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 135.Callback((ViewContext v) => v.Writer.WriteAsync(v.ViewData.TemplateInfo.FormattedModelValue.ToString())) 160view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 161.Callback((ViewContext v) => v.Writer.WriteAsync(v.ViewData.TemplateInfo.FormattedModelValue.ToString())) 186view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 187.Callback((ViewContext v) => v.Writer.WriteAsync(v.ViewData["SomeProperty"].ToString())) 214view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 215.Callback((ViewContext v) => v.Writer.WriteAsync(v.ViewData.TemplateInfo.HtmlFieldPrefix)) 242view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 243.Callback((ViewContext v) => v.Writer.WriteAsync(v.ViewData["SomeProperty"].ToString())) 289view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 290.Callback((ViewContext v) => v.Writer.WriteAsync(v.ViewData["SomeProperty"].ToString())) 320view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 321.Callback((ViewContext v) => v.Writer.WriteAsync(v.ViewData.TemplateInfo.FormattedModelValue.ToString())) 361view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 362.Callback((ViewContext v) => v.Writer.WriteAsync(v.ViewData.TemplateInfo.FormattedModelValue.ToString())) 386view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 387.Callback((ViewContext v) => v.Writer.WriteAsync(v.ViewData.TemplateInfo.HtmlFieldPrefix)) 414view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 415.Callback((ViewContext v) => v.Writer.WriteAsync(v.ViewData["SomeProperty"].ToString())) 461view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 462.Callback((ViewContext v) => v.Writer.WriteAsync(v.ViewData["SomeProperty"].ToString())) 488view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 489.Callback((ViewContext v) => v.Writer.WriteAsync(v.ViewData.TemplateInfo.HtmlFieldPrefix))
Rendering\HtmlHelperEditorExtensionsTest.cs (4)
18view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 19.Callback((ViewContext v) => v.Writer.WriteAsync(v.ViewData.TemplateInfo.FormattedModelValue.ToString())) 44view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 45.Callback((ViewContext v) => v.Writer.WriteAsync(v.ViewData.TemplateInfo.FormattedModelValue.ToString()))
Rendering\HtmlHelperFormTest.cs (34)
340var viewContext = htmlHelper.ViewContext; 372It.IsAny<ViewContext>(), 381.Setup(g => g.GenerateAntiforgery(It.IsAny<ViewContext>())) 387var viewContext = htmlHelper.ViewContext; 410It.IsAny<ViewContext>(), 419.Setup(g => g.GenerateAntiforgery(It.IsAny<ViewContext>())) 425var viewContext = htmlHelper.ViewContext; 449It.IsAny<ViewContext>(), 458.Setup(g => g.GenerateAntiforgery(It.IsAny<ViewContext>())) 464var viewContext = htmlHelper.ViewContext; 487It.IsAny<ViewContext>(), 496.Setup(g => g.GenerateAntiforgery(It.IsAny<ViewContext>())) 502var viewContext = htmlHelper.ViewContext; 527It.IsAny<ViewContext>(), 536.Setup(g => g.GenerateAntiforgery(It.IsAny<ViewContext>())) 542var viewContext = htmlHelper.ViewContext; 566It.IsAny<ViewContext>(), 575.Setup(g => g.GenerateAntiforgery(It.IsAny<ViewContext>())) 581var viewContext = htmlHelper.ViewContext; 607It.IsAny<ViewContext>(), 615.Setup(g => g.GenerateAntiforgery(It.IsAny<ViewContext>())) 621var viewContext = htmlHelper.ViewContext; 644It.IsAny<ViewContext>(), 652.Setup(g => g.GenerateAntiforgery(It.IsAny<ViewContext>())) 658var viewContext = htmlHelper.ViewContext; 687It.IsAny<ViewContext>(), 695.Setup(g => g.GenerateAntiforgery(It.IsAny<ViewContext>())) 701var viewContext = htmlHelper.ViewContext; 729It.IsAny<ViewContext>(), 737.Setup(g => g.GenerateAntiforgery(It.IsAny<ViewContext>())) 743var viewContext = htmlHelper.ViewContext; 773It.IsAny<ViewContext>(), 781.Setup(g => g.GenerateAntiforgery(It.IsAny<ViewContext>())) 787var viewContext = htmlHelper.ViewContext;
Rendering\HtmlHelperTest.cs (5)
294var viewContext = DefaultTemplatesUtilities 315var viewContext = DefaultTemplatesUtilities 319var expectedMessage = $"Property '{nameof(ViewContext.ViewData)}' is of type " + 335var viewContext = DefaultTemplatesUtilities 340var expectedMessage = $"Property '{nameof(ViewContext.ViewData)}' is of type " +
Rendering\ViewContextTests.cs (3)
22var context = new ViewContext( 49var originalContext = new ViewContext( 61var context = new ViewContext(originalContext, view, viewData, writer);
ViewComponents\ContentViewComponentResultTest.cs (1)
42var viewContext = new ViewContext(
ViewComponents\HtmlContentViewComponentResultTest.cs (1)
42var viewContext = new ViewContext(
ViewComponents\ViewComponentContextTest.cs (2)
25var viewContext = new ViewContext( 87var viewContext = new ViewContext(
ViewComponents\ViewViewComponentResultTest.cs (5)
30view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 69view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 103view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 264view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 522var viewContext = new ViewContext(
ViewComponentTests.cs (1)
242var viewContext = new ViewContext();
ViewExecutorTest.cs (4)
301view.Setup(v => v.RenderAsync(It.IsAny<ViewContext>())) 302.Callback((ViewContext v) => 380private IView CreateView(Func<ViewContext, Task> action) 384.Setup(v => v.RenderAsync(It.IsAny<ViewContext>()))
ViewResultTest.cs (1)
197.Setup(v => v.RenderAsync(It.IsAny<ViewContext>()))
RazorWebSite (2)
Services\BackSlashExpander.cs (1)
17if (context.ActionContext is ViewContext viewContext && (string)viewContext.ViewData["back-slash"] == "true")
Services\TestBodyTagHelperComponent.cs (1)
26public ViewContext ViewContext { get; set; }
TagHelpersWebSite (3)
TagHelpers\ATagHelper.cs (1)
24public ViewContext ViewContext { get; set; }
TagHelpers\PrettyTagHelper.cs (1)
29public ViewContext ViewContext { get; set; }
TagHelpers\TagCloudViewComponentTagHelper.cs (1)
36public ViewContext ViewContext { get; set; }