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