14 writes to ViewData
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (14)
ControllerTest.cs (14)
39
var originalViewData = controller.
ViewData
= new ViewDataDictionary<object>(metadataProvider);
44
controller.
ViewData
= replacementViewData;
69
ViewData
= new ViewDataDictionary(new EmptyModelMetadataProvider()),
90
ViewData
= new ViewDataDictionary(new EmptyModelMetadataProvider()),
114
ViewData
= new ViewDataDictionary(new EmptyModelMetadataProvider()),
135
ViewData
= new ViewDataDictionary(new EmptyModelMetadataProvider()),
157
ViewData
= new ViewDataDictionary(new EmptyModelMetadataProvider()),
179
ViewData
= new ViewDataDictionary(new EmptyModelMetadataProvider()),
201
ViewData
= new ViewDataDictionary(new EmptyModelMetadataProvider()),
225
ViewData
= new ViewDataDictionary(new EmptyModelMetadataProvider()),
248
ViewData
= new ViewDataDictionary(new EmptyModelMetadataProvider()),
270
ViewData
= new ViewDataDictionary(new EmptyModelMetadataProvider()),
292
ViewData
= new ViewDataDictionary(new EmptyModelMetadataProvider()),
457
ViewData
= viewData,
94 references to ViewData
BasicWebSite (7)
Controllers\AntiforgeryController.cs (2)
23
ViewData
["ReturnUrl"] = returnUrl;
57
ViewData
["ReturnUrl"] = returnUrl;
Controllers\HomeController.cs (1)
95
ViewData
["naming"] = snakeCase ? (NamingStrategy)new SnakeCaseNamingStrategy() : new DefaultNamingStrategy();
Controllers\PageRouteController.cs (2)
32
ViewData
["page"] = page;
39
ViewData
["page"] = page;
Controllers\TempDataPropertyController.cs (2)
35
ViewData
["Message"] = Message;
36
ViewData
["NullableInt"] = NullableInt;
ClaimsTransformation (2)
Controllers\AccountController.cs (2)
18
ViewData
["ReturnUrl"] = returnUrl;
31
ViewData
["ReturnUrl"] = returnUrl;
Cookies (2)
Controllers\AccountController.cs (2)
17
ViewData
["ReturnUrl"] = returnUrl;
30
ViewData
["ReturnUrl"] = returnUrl;
CustomPolicyProvider (1)
Controllers\AccountController.cs (1)
16
ViewData
["ReturnUrl"] = returnUrl;
HtmlGenerationWebSite (17)
Controllers\Catalog_CacheTagHelperController.cs (12)
16
ViewData
["Category"] = category;
17
ViewData
["Locale"] = locale;
18
ViewData
["CorrelationId"] = correlationId;
26
ViewData
["ProductId"] = id;
33
ViewData
["CorrelationId"] = correlationId;
40
ViewData
["Message"] = "Welcome Guest. Your confirmation id is " + confirmationId;
41
ViewData
["Region"] = region;
49
ViewData
["Message"] = message;
50
ViewData
["Region"] = region;
62
ViewData
["CorrelationId"] = correlationId;
69
ViewData
["Category"] = category;
70
ViewData
["CorrelationId"] = correlationId;
Controllers\HtmlGeneration_HomeController.cs (5)
66
ViewData
["Items"] = _productsListWithSelection;
73
ViewData
["Items"] = _productsListWithSelection;
147
ViewData
[nameof(Employee.Gender)] = "Gender value that will not match.";
148
ViewData
[nameof(Employee.Name)] = "Name value that should not be seen.";
155
ViewData
["Items"] = _productsList;
IdentitySample.Mvc (10)
Controllers\AccountController.cs (7)
44
ViewData
["ReturnUrl"] = returnUrl;
55
ViewData
["ReturnUrl"] = returnUrl;
92
ViewData
["ReturnUrl"] = returnUrl;
103
ViewData
["ReturnUrl"] = returnUrl;
189
ViewData
["ReturnUrl"] = returnUrl;
190
ViewData
["ProviderDisplayName"] = info.ProviderDisplayName;
230
ViewData
["ReturnUrl"] = returnUrl;
Controllers\ManageController.cs (3)
41
ViewData
["StatusMessage"] =
296
ViewData
["StatusMessage"] =
309
ViewData
["ShowRemoveButton"] = user.PasswordHash != null || userLogins.Count > 1;
Microsoft.AspNetCore.Mvc.ViewFeatures (10)
Controller.cs (10)
55
throw new ArgumentException(Resources.ArgumentCannotBeNullOrEmpty, nameof(
ViewData
));
94
_viewBag = new DynamicViewData(() =>
ViewData
);
119
return View(viewName, model:
ViewData
.Model);
144
ViewData
.Model = model;
149
ViewData =
ViewData
,
172
return PartialView(viewName, model:
ViewData
.Model);
197
ViewData
.Model = model;
202
ViewData =
ViewData
,
253
ViewData =
ViewData
,
276
ViewData =
ViewData
,
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (27)
ControllerTest.cs (23)
48
Assert.NotSame(originalViewData, controller.
ViewData
);
49
Assert.Same(replacementViewData, controller.
ViewData
);
52
Assert.Equal("property", controller.
ViewData
["Another"]);
79
Assert.Same(controller.
ViewData
, actualViewResult.ViewData);
95
controller.
ViewData
.Model = model;
103
Assert.Same(controller.
ViewData
, actualViewResult.ViewData);
124
Assert.Same(controller.
ViewData
, actualViewResult.ViewData);
146
Assert.Same(controller.
ViewData
, actualViewResult.ViewData);
168
Assert.Same(controller.
ViewData
, actualViewResult.ViewData);
182
controller.
ViewData
.Model = new object();
190
Assert.Same(controller.
ViewData
, actualViewResult.ViewData);
206
controller.
ViewData
.Model = model;
214
Assert.Same(controller.
ViewData
, actualViewResult.ViewData);
229
controller.
ViewData
.Model = model;
237
Assert.Same(controller.
ViewData
, actualViewResult.ViewData);
259
Assert.Same(controller.
ViewData
, actualViewResult.ViewData);
281
Assert.Same(controller.
ViewData
, actualViewResult.ViewData);
295
controller.
ViewData
.Model = new object();
303
Assert.Same(controller.
ViewData
, actualViewResult.ViewData);
418
Assert.NotNull(controller.
ViewData
);
421
controller.
ViewData
.Model = model;
424
Assert.NotNull(controller.
ViewData
.ModelMetadata);
425
Assert.Equal(expectedType, controller.
ViewData
.ModelMetadata.ModelType);
ControllerUnitTestabilityTests.cs (4)
34
Assert.Same(controller.
ViewData
, viewResult.ViewData);
56
Assert.Same(controller.
ViewData
, viewResult.ViewData);
629
Assert.Equal(controller1.ModelState, controller1.
ViewData
.ModelState);
633
Assert.Equal(controller1.ControllerContext.ModelState, controller2.
ViewData
.ModelState);
PathSchemeSelection (2)
Controllers\AccountController.cs (2)
18
ViewData
["ReturnUrl"] = returnUrl;
31
ViewData
["ReturnUrl"] = returnUrl;
RazorWebSite (8)
Controllers\AddTagHelperComponentController.cs (1)
21
ViewData
["TestData"] = "Value";
Controllers\PartialViewEngineController.cs (1)
32
ViewData
["data-from-controller"] = "hello from controller";
Controllers\ViewEngineController.cs (4)
37
ViewData
["TestKey"] = "test-value";
59
ViewData
["Title"] = "Controller title";
65
ViewData
["data-from-controller"] = "hello from controller";
71
ViewData
["Title"] = "View With Component With Layout";
Controllers\ViewNameSpecification_HomeController.cs (2)
52
ViewData
["Layout"] = "_NonSharedLayout.cshtml";
58
ViewData
["Layout"] = "~/Views/ViewNameSpecification_Home/_NonSharedLayout.cshtml";
StaticFilesAuth (2)
Controllers\AccountController.cs (2)
17
ViewData
["ReturnUrl"] = returnUrl;
30
ViewData
["ReturnUrl"] = returnUrl;
TagHelpersWebSite (5)
Controllers\EncodersController.cs (5)
12
ViewData
["Title"] = "Using the default HTML encoder";
18
ViewData
["Title"] = "Using a custom HTML encoder";
24
ViewData
["Title"] = "Using the null HTML encoder";
32
ViewData
["Title"] = "Using two HTML encoders";
40
ViewData
["Title"] = "Using three HTML encoders";
XmlFormattersWebSite (1)
Controllers\SerializableErrorController.cs (1)
26
ModelState.AddModelError("key2", exception,
ViewData
.ModelMetadata);