Implemented interface member:
property
ViewContext
Microsoft.AspNetCore.Mvc.Razor.IRazorPage.ViewContext
1 override of ViewContext
Microsoft.AspNetCore.Mvc.RazorPages (1)
PageBase.cs (1)
37
public override ViewContext
ViewContext
{ get; set; } = default!;
6 writes to ViewContext
Microsoft.AspNetCore.Mvc.Razor.Test (5)
RazorPageCreateModelExpressionTest.cs (3)
277
ViewContext
= viewContext,
287
ViewContext
= viewContext,
297
ViewContext
= viewContext,
RazorPageCreateTagHelperTest.cs (1)
105
ViewContext
= viewContext
RazorPageTest.cs (1)
1401
view.Object.
ViewContext
= context;
Microsoft.AspNetCore.Mvc.RazorPages (1)
Infrastructure\RazorPageAdapter.cs (1)
35
set { _page.
ViewContext
= value; }
39 references to ViewContext
Microsoft.AspNetCore.Mvc.Razor (21)
RazorPage.cs (2)
23
public HttpContext Context =>
ViewContext
?.HttpContext!;
174
var viewContext =
ViewContext
;
RazorPageBase.cs (19)
62
var viewContext =
ViewContext
;
65
throw new InvalidOperationException(Resources.FormatViewContextMustBeSet(nameof(
ViewContext
), nameof(Output)));
82
public dynamic ViewBag =>
ViewContext
?.ViewBag!;
134
public virtual ClaimsPrincipal User =>
ViewContext
.HttpContext.User;
137
/// Gets the <see cref="ITempDataDictionary"/> from the <see cref="
ViewContext
"/>.
139
/// <remarks>Returns null if <see cref="
ViewContext
"/> is null.</remarks>
140
public ITempDataDictionary TempData =>
ViewContext
?.TempData!;
150
var services =
ViewContext
.HttpContext.RequestServices;
164
var services =
ViewContext
.HttpContext.RequestServices;
204
return TagHelperFactory.CreateTagHelper<TTagHelper>(
ViewContext
);
220
var viewContext =
ViewContext
;
254
ViewContext
.Writer = scopeInfo.Writer;
276
var viewContext =
ViewContext
;
310
ViewContext
.Writer = _pageWriter;
325
var viewContext =
ViewContext
;
337
var viewContext =
ViewContext
;
354
var viewContext =
ViewContext
;
701
await
ViewContext
.HttpContext.Response.Body.FlushAsync();
713
var viewContext =
ViewContext
;
Microsoft.AspNetCore.Mvc.Razor.Test (17)
RazorPageCreateModelExpressionTest.cs (1)
365
return ModelExpressionProvider.CreateModelExpression(ViewData, m =>
ViewContext
.ViewData.Model);
RazorPageTest.cs (8)
41
v.
ViewContext
.Writer.Write("Hello from view context writer");
1275
Assert.Same(writer, page.
ViewContext
.Writer);
1284
page.
ViewContext
.Writer = defaultWriter;
1292
Assert.Same(writer, page.
ViewContext
.Writer);
1299
Assert.Same(defaultWriter, page.
ViewContext
.Writer);
1308
page.
ViewContext
.Writer = defaultWriter;
1323
page.
ViewContext
.Writer = defaultWriter;
1366
page.
ViewContext
.Writer = writer;
RazorViewTest.cs (8)
65
Assert.Same(viewData, v.
ViewContext
.ViewData);
103
Assert.Same(viewData, v.
ViewContext
.ViewData);
152
paths.Add(v.
ViewContext
.ExecutingFilePath);
153
Assert.Equal(pagePath, v.
ViewContext
.View.Path);
162
paths.Add(v.
ViewContext
.ExecutingFilePath);
163
Assert.Equal(pagePath, v.
ViewContext
.View.Path);
172
paths.Add(v.
ViewContext
.ExecutingFilePath);
173
Assert.Equal(pagePath, v.
ViewContext
.View.Path);
Microsoft.AspNetCore.Mvc.RazorPages (1)
Infrastructure\RazorPageAdapter.cs (1)
34
get { return _page.
ViewContext
; }