52 references to Model
Microsoft.AspNetCore.Mvc.TagHelpers (6)
InputTagHelper.cs (6)
304if (modelExplorer.Model != null) 306if (!bool.TryParse(modelExplorer.Model.ToString(), out _)) 310modelExplorer.Model.ToString(), 406(modelExplorer.Model is DateTime || modelExplorer.Model is DateTimeOffset)) 435modelExplorer.Model,
Microsoft.AspNetCore.Mvc.TagHelpers.Test (1)
InputTagHelperTest.cs (1)
871modelExplorer.Model,
Microsoft.AspNetCore.Mvc.ViewFeatures (30)
DefaultDisplayTemplates.cs (1)
192if (modelExplorer.Model == null)
DefaultEditorTemplates.cs (1)
236if (modelExplorer.Model == null)
DefaultHtmlGenerator.cs (6)
201if (modelExplorer.Model != null) 203if (bool.TryParse(modelExplorer.Model.ToString(), out var modelChecked)) 459var model = modelExplorer.Model; 639else if (modelExplorer.Model != null) 641value = modelExplorer.Model.ToString(); 929rawValue = modelExplorer.Model;
FormatWeekHelper.cs (1)
12var value = modelExplorer.Model;
ModelExplorer.cs (4)
118/// Retrieving the <see cref="Model"/> object will execute the model accessor function if this 128_model = _modelAccessor(Container.Model); 154if (Model == null) 162return Model.GetType();
ModelExplorerExtensions.cs (10)
15/// Gets a simple display string for the <see cref="ModelExplorer.Model"/> property 23/// <see cref="ModelExplorer.Model" /> converted to string (if the result is interesting), 37if (propertyExplorer?.Model != null) 39return propertyExplorer.Model.ToString(); 43if (modelExplorer.Model == null) 48if (modelExplorer.Metadata.IsEnum && modelExplorer.Model is Enum modelEnum) 64var stringResult = Convert.ToString(modelExplorer.Model, CultureInfo.CurrentCulture); 70if (!stringResult.Equals(modelExplorer.Model.GetType().FullName, StringComparison.Ordinal)) 82if (firstProperty.Model == null) 87return Convert.ToString(firstProperty.Model, CultureInfo.CurrentCulture);
ModelExpression.cs (2)
48public object Model => ModelExplorer.Model; 54/// Getting <see cref="ModelExplorer.Model"/> will evaluate a compiled version of the original
TemplateBuilder.cs (1)
55_model = modelExplorer.Model;
TemplateInfo.cs (1)
117return _visitedObjects.Contains(modelExplorer.Model ?? modelExplorer.Metadata.ModelType);
ViewDataDictionary.cs (3)
215else if (object.ReferenceEquals(model, source.ModelExplorer.Model)) 263return ModelExplorer.Model; 434/// Set <see cref="ModelExplorer"/> to ensure <see cref="Model"/> and <see cref="ModelExplorer.Model"/>
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (15)
ExpressionMetadataProviderTest.cs (7)
32Assert.Null(explorer.Model); 50Assert.Null(explorer.Model); 68Assert.Null(explorer.Model); 90Assert.Null(explorer.Model); 109Assert.Same(myModel, metadata.Container.Model); 134Assert.Null(explorer.Model); 152Assert.Same(myModel, metadata.Container.Model);
ModelExplorerTest.cs (2)
98var propertyValue = propertyExplorer.Model; 114var propertyValue = propertyExplorer.Model;
Rendering\DefaultTemplatesUtilities.cs (1)
340modelExplorer.Model ?? "(null)",
ViewDataDictionaryOfTModelTest.cs (2)
281Assert.Equal(viewData.Model, viewData.ModelExplorer.Model); 322Assert.Equal(viewData.Model, viewData.ModelExplorer.Model);
ViewDataDictionaryTest.cs (3)
337Assert.Equal(5, viewData.ModelExplorer.Model); 389Assert.Equal(viewData.Model, viewData.ModelExplorer.Model); 429Assert.Equal(3, viewData.ModelExplorer.Model);