40 references to ViewData
HtmlGenerationWebSite (5)
Components\CheckViewData - LackModel.cs (3)
14
var metadata =
ViewData
.ModelMetadata;
25
ViewData
.Model = 78.9;
28
metadata =
ViewData
.ModelMetadata;
Components\CheckViewData.cs (1)
13
var metadata =
ViewData
.ModelMetadata;
Components\SplashViewComponent.cs (1)
12
var region = (string)
ViewData
["Locale"];
Microsoft.AspNetCore.Mvc.ViewFeatures (4)
ViewComponent.cs (4)
65
_viewBag = new DynamicViewData(() =>
ViewData
);
75
public ModelStateDictionary ModelState =>
ViewData
?.ModelState!;
193
return View(viewName,
ViewData
.Model);
214
var viewData = new ViewDataDictionary<TModel?>(
ViewData
, model);
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (29)
ViewComponentTests.cs (29)
28
Assert.Equal(2, viewComponent.
ViewData
.Count);
29
Assert.Equal("Alice", viewComponent.
ViewData
["A"]);
30
Assert.Equal("Bob", viewComponent.
ViewData
["B"]);
40
viewComponent.
ViewData
["A"] = "Alice";
41
viewComponent.
ViewData
["B"] = "Bob";
44
Assert.Equal(2, viewComponent.
ViewData
.Count);
76
Assert.NotSame(viewComponent.
ViewData
, actualResult.ViewData);
77
Assert.Equal(new ViewDataDictionary<object>(viewComponent.
ViewData
), actualResult.ViewData);
88
viewComponent.
ViewData
.Model = model;
95
Assert.NotSame(viewComponent.
ViewData
, actualResult.ViewData);
96
Assert.Equal(new ViewDataDictionary<object>(viewComponent.
ViewData
), actualResult.ViewData);
113
Assert.NotSame(viewComponent.
ViewData
, actualResult.ViewData);
114
Assert.Equal(new ViewDataDictionary<object>(viewComponent.
ViewData
), actualResult.ViewData);
133
Assert.NotSame(viewComponent.
ViewData
, actualResult.ViewData);
134
Assert.Equal(new ViewDataDictionary<object>(viewComponent.
ViewData
), actualResult.ViewData);
144
viewComponent.
ViewData
.Model = new object();
153
Assert.NotSame(viewComponent.
ViewData
, actualResult.ViewData);
154
Assert.Equal(new ViewDataDictionary<object>(viewComponent.
ViewData
), actualResult.ViewData);
164
viewComponent.
ViewData
.Model = new object();
172
Assert.NotSame(viewComponent.
ViewData
, actualResult.ViewData);
173
Assert.Equal(new ViewDataDictionary<object>(viewComponent.
ViewData
), actualResult.ViewData);
183
viewComponent.
ViewData
.Model = "Hello World!";
191
Assert.NotSame(viewComponent.
ViewData
, actualResult.ViewData);
192
Assert.Equal(new ViewDataDictionary<string>(viewComponent.
ViewData
), actualResult.ViewData);
211
Assert.NotSame(viewComponent.
ViewData
, actualResult.ViewData);
212
Assert.Equal(new ViewDataDictionary<object>(viewComponent.
ViewData
), actualResult.ViewData);
231
Assert.NotNull(viewComponent.
ViewData
);
232
Assert.Empty(viewComponent.
ViewData
);
233
Assert.Same(viewComponent.
ViewData
, viewComponent.ViewContext.ViewData);
RazorWebSite (2)
Components\ComponentWithLayout.cs (1)
12
ViewData
["Title"] = "ViewComponent With Title";
Components\ComponentWithViewStart.cs (1)
12
ViewData
["Title"] = "ViewComponent With ViewStart";