1 override of ModelName
Microsoft.AspNetCore.Mvc.Core (1)
ModelBinding\DefaultModelBindingContext.cs (1)
70public override string ModelName
10 writes to ModelName
Microsoft.AspNetCore.Mvc.Core (5)
ModelBinding\Binders\DictionaryModelBinder.cs (2)
196bindingContext.ModelName = ModelNames.CreatePropertyModelName(prefix, kvp.Key); 200bindingContext.ModelName = ModelNames.CreateIndexModelName(prefix, kvp.Key);
ModelBinding\ParameterBinder.cs (3)
119modelBindingContext.ModelName = parameterModelName; 124modelBindingContext.ModelName = parameter.Name; 129modelBindingContext.ModelName = string.Empty;
Microsoft.AspNetCore.Mvc.Core.Test (5)
ModelBinding\Binders\FormFileModelBinderTest.cs (5)
57bindingContext.ModelName = string.Empty; 97bindingContext.ModelName = propertyName; 139bindingContext.ModelName = propertyName; 173bindingContext.ModelName = "[myFile]"; 209bindingContext.ModelName = "[myFile]";
77 references to ModelName
BasicWebSite (1)
Controllers\ContactApiController.cs (1)
147var val = bindingContext.ValueProvider.GetValue(bindingContext.ModelName);
Microsoft.AspNetCore.Mvc.Abstractions (1)
ModelBinding\ModelBindingContext.cs (1)
132/// <param name="modelName">Name to assign to the <see cref="ModelName"/> property.</param>
Microsoft.AspNetCore.Mvc.Core (68)
ModelBinding\Binders\BodyModelBinder.cs (1)
103modelBindingKey = bindingContext.ModelName;
ModelBinding\Binders\ByteArrayModelBinder.cs (3)
36var valueProviderResult = bindingContext.ValueProvider.GetValue(bindingContext.ModelName); 44bindingContext.ModelState.SetModelValue(bindingContext.ModelName, valueProviderResult); 63bindingContext.ModelName,
ModelBinding\Binders\CollectionModelBinder.cs (12)
112if (!bindingContext.ValueProvider.ContainsPrefix(bindingContext.ModelName)) 137var valueProviderResult = bindingContext.ValueProvider.GetValue(bindingContext.ModelName); 182bindingContext.ModelName, 222bindingContext.ModelState.TryAddModelError(bindingContext.ModelName, message); 278modelName: bindingContext.ModelName, 284new ElementalValueProvider(bindingContext.ModelName, value, values.Culture), 306var indexPropertyName = ModelNames.CreatePropertyModelName(bindingContext.ModelName, "index"); 348var fullChildName = ModelNames.CreateIndexModelName(bindingContext.ModelName, indexName); 382var name = string.IsNullOrEmpty(bindingContext.ModelName) ? 387bindingContext.ModelName; 499var modelName = bindingContext.ModelName; 534=> NoNonIndexBasedFormatFoundForCollection(logger, bindingContext.ModelName);
ModelBinding\Binders\ComplexObjectModelBinder.cs (11)
122bindingContext.ModelState.TryAddModelError(bindingContext.ModelName, message); 167AddModelError(ex, bindingContext.ModelName, bindingContext); 242var modelName = ModelNames.CreatePropertyModelName(bindingContext.ModelName, fieldName); 304var modelName = ModelNames.CreatePropertyModelName(bindingContext.ModelName, fieldName); 367var modelName = ModelNames.CreatePropertyModelName(bindingContext.ModelName, fieldName); 396var modelName = ModelNames.CreatePropertyModelName(bindingContext.ModelName, fieldName); 596var modelName = ModelNames.CreatePropertyModelName(bindingContext.ModelName, fieldName); 604if (bindingContext.ValueProvider.ContainsPrefix(bindingContext.ModelName)) 632var modelName = ModelNames.CreatePropertyModelName(bindingContext.ModelName, fieldName); 640if (bindingContext.ValueProvider.ContainsPrefix(bindingContext.ModelName)) 742NoPublicSettableItems(logger, bindingContext.ModelName, bindingContext.ModelType);
ModelBinding\Binders\ComplexTypeModelBinder.cs (6)
142var modelName = ModelNames.CreatePropertyModelName(bindingContext.ModelName, fieldName); 170var modelName = ModelNames.CreatePropertyModelName(bindingContext.ModelName, fieldName); 187bindingContext.ModelState.TryAddModelError(bindingContext.ModelName, message); 397var modelName = ModelNames.CreatePropertyModelName(bindingContext.ModelName, fieldName); 405if (bindingContext.ValueProvider.ContainsPrefix(bindingContext.ModelName)) 575=> NoPublicSettableProperties(logger, bindingContext.ModelName, bindingContext.ModelType);
ModelBinding\Binders\DateTimeModelBinder.cs (1)
39var modelName = bindingContext.ModelName;
ModelBinding\Binders\DecimalModelBinder.cs (1)
41var modelName = bindingContext.ModelName;
ModelBinding\Binders\DictionaryModelBinder.cs (4)
143var prefix = bindingContext.ModelName; 174bindingContext.ModelState.AddModelError(bindingContext.ModelName, ex.Message); 209keyMappings.Add(bindingContext.ModelName, convertedKey); 266=> NoKeyValueFormatForDictionaryModelBinder(logger, bindingContext.ModelName);
ModelBinding\Binders\DoubleModelBinder.cs (1)
41var modelName = bindingContext.ModelName;
ModelBinding\Binders\EnumTypeModelBinder.cs (1)
52bindingContext.ModelName,
ModelBinding\Binders\FloatModelBinder.cs (1)
41var modelName = bindingContext.ModelName;
ModelBinding\Binders\FormFileModelBinder.cs (1)
62: bindingContext.ModelName;
ModelBinding\Binders\HeaderModelBinder.cs (2)
85modelName: bindingContext.ModelName, 155bindingContext.ModelName,
ModelBinding\Binders\KeyValuePairModelBinder.cs (2)
45var keyModelName = ModelNames.CreatePropertyModelName(bindingContext.ModelName, "Key"); 48var valueModelName = ModelNames.CreatePropertyModelName(bindingContext.ModelName, "Value");
ModelBinding\Binders\SimpleTypeModelBinder.cs (4)
41var valueProviderResult = bindingContext.ValueProvider.GetValue(bindingContext.ModelName); 51bindingContext.ModelState.SetModelValue(bindingContext.ModelName, valueProviderResult); 98bindingContext.ModelName, 123bindingContext.ModelName,
ModelBinding\Binders\TryParseModelBinder.cs (4)
49var valueProviderResult = bindingContext.ValueProvider.GetValue(bindingContext.ModelName); 59bindingContext.ModelState.SetModelValue(bindingContext.ModelName, valueProviderResult); 74bindingContext.ModelName, 102bindingContext.ModelName,
ModelBinding\ModelBindingHelper.cs (1)
276modelBindingContext.ModelName,
ModelBinding\ParameterBinder.cs (4)
163modelBindingContext.ModelName, 195modelBindingContext.ModelName, 211var modelName = modelBindingContext.ModelName; 213if (string.IsNullOrEmpty(modelBindingContext.ModelName) &&
MvcCoreLoggerExtensions.cs (8)
126bindingContext.ModelName, 133bindingContext.ModelName, 141bindingContext.ModelName, 161=> CannotBindToFilesCollectionDueToUnsupportedContentType(logger, bindingContext.ModelName, bindingContext.ModelType); 183bindingContext.ModelName); 191bindingContext.ModelName); 194AttemptingToBindModel(logger, bindingContext.ModelType, bindingContext.ModelName); 232DoneAttemptingToBindModel(logger, bindingContext.ModelType, bindingContext.ModelName);
Microsoft.AspNetCore.Mvc.Core.Test (4)
ControllerBaseTest.cs (1)
2616Assert.Empty(context.ModelName);
ModelBinding\Binders\CollectionModelBinderTest.cs (2)
461Assert.Equal("someName", mbc.ModelName); 501var value = context.ValueProvider.GetValue(context.ModelName);
ModelBinding\Binders\KeyValuePairModelBinderTest.cs (1)
125Assert.Equal("someName.Key", context.ModelName);
Microsoft.AspNetCore.Mvc.IntegrationTests (3)
BinderTypeBasedModelBinderIntegrationTest.cs (3)
332ModelNames.CreatePropertyModelName(bindingContext.ModelName, "Street"), 357ModelNames.CreatePropertyModelName(bindingContext.ModelName, "Street"), 375bindingContext.ModelName,