21 references to AddModelError
Microsoft.AspNetCore.Mvc.Abstractions (2)
ModelBinding\ModelStateDictionary.cs (2)
97/// <see cref="AddModelError(string, Exception, ModelMetadata)"/> or 199/// Where <see cref="ModelMetadata"/> is available, use <see cref="AddModelError(string, Exception, ModelMetadata)"/> instead.
Microsoft.AspNetCore.Mvc.Abstractions.Test (5)
ModelBinding\ModelStateDictionaryTest.cs (5)
330dictionary.AddModelError("some key", exception, metadata); 761dictionary.AddModelError("key2", new Exception(), metadata); 762dictionary.AddModelError("key3", new Exception(), metadata); 861dictionary.AddModelError("key1", new Exception(), metadata); 864dictionary.AddModelError("key3", new Exception(), metadata);
Microsoft.AspNetCore.Mvc.Core (5)
Formatters\TextInputFormatter.cs (1)
46context.ModelState.AddModelError(context.ModelName, exception, context.Metadata);
ModelBinding\Binders\BodyModelBinder.cs (2)
148bindingContext.ModelState.AddModelError(modelBindingKey, exception, bindingContext.ModelMetadata); 185bindingContext.ModelState.AddModelError(modelBindingKey, exception, bindingContext.ModelMetadata);
ModelBinding\Binders\ComplexObjectModelBinder.cs (1)
730modelState.AddModelError(modelName, exception, bindingContext.ModelMetadata);
ModelBinding\Binders\ComplexTypeModelBinder.cs (1)
568modelState.AddModelError(modelName, exception, bindingContext.ModelMetadata);
Microsoft.AspNetCore.Mvc.Core.Test (3)
ModelBinding\UnsupportedContentTypeFilterTest.cs (2)
31context.ModelState.AddModelError( 114context.ModelState.AddModelError(
ValidationProblemDetailsTest.cs (1)
57modelStateDictionary.AddModelError("unsafeError",
Microsoft.AspNetCore.Mvc.ViewFeatures (1)
ModelStateDictionaryExtensions.cs (1)
84modelState.AddModelError(GetExpressionText(expression), exception, metadata);
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (4)
Rendering\HtmlHelperValidationSummaryTest.cs (4)
673modelState.AddModelError("Property3", new InvalidCastException("Exception will be ignored."), metadata); 678modelState.AddModelError("Property2", new OverflowException("Produces invalid value message"), metadata); 683modelState.AddModelError(string.Empty, new InvalidOperationException("Another ignored Exception."), metadata); 692modelState.AddModelError("Property3", new InvalidCastException("An ignored Exception."), metadata);
XmlFormattersWebSite (1)
Controllers\SerializableErrorController.cs (1)
26ModelState.AddModelError("key2", exception, ViewData.ModelMetadata);