27 references to TryAddModelError
Microsoft.AspNetCore.Mvc.Abstractions (2)
ModelBinding\ModelStateDictionary.cs (2)
98/// <see cref="TryAddModelError(string, Exception, ModelMetadata)"/>. 245TryAddModelError(key, exception, metadata);
Microsoft.AspNetCore.Mvc.Abstractions.Test (15)
ModelBinding\ModelStateDictionaryTest.cs (15)
824result = dictionary.TryAddModelError("key2", new Exception(), metadata); 896result = dictionary.TryAddModelError("key2", new Exception(), metadata); 899result = dictionary.TryAddModelError("key3", new Exception(), metadata); 922dictionary.TryAddModelError("key3", new Exception(), metadata); 983dictionary.TryAddModelError("key", new FormatException(), metadata); 1007dictionary.TryAddModelError("key", new FormatException(), metadata); 1035dictionary.TryAddModelError("key", new FormatException(), metadata); 1061dictionary.TryAddModelError("key", new FormatException(), metadata); 1097dictionary.TryAddModelError("key", new FormatException(), metadata); 1122dictionary.TryAddModelError("key", new FormatException(), metadata); 1151dictionary.TryAddModelError("key", new FormatException(), metadata); 1178dictionary.TryAddModelError("key", new FormatException(), metadata); 1197dictionary.TryAddModelError("key", new InvalidOperationException(), metadata); 1251dictionary.TryAddModelError("key", new InputFormatterException(expectedMessage), metadata); 1271dictionary.TryAddModelError("key", new ValueProviderException(expectedMessage), metadata);
Microsoft.AspNetCore.Mvc.Core (9)
Formatters\SystemTextJsonInputFormatter.cs (2)
74context.ModelState.TryAddModelError(path, modelStateException, context.Metadata); 85context.ModelState.TryAddModelError(string.Empty, exception, context.Metadata);
ModelBinding\Binders\ByteArrayModelBinder.cs (1)
62bindingContext.ModelState.TryAddModelError(
ModelBinding\Binders\DateTimeModelBinder.cs (1)
92modelState.TryAddModelError(modelName, exception, metadata);
ModelBinding\Binders\DecimalModelBinder.cs (1)
102modelState.TryAddModelError(modelName, exception, metadata);
ModelBinding\Binders\DoubleModelBinder.cs (1)
102modelState.TryAddModelError(modelName, exception, metadata);
ModelBinding\Binders\FloatModelBinder.cs (1)
102modelState.TryAddModelError(modelName, exception, metadata);
ModelBinding\Binders\SimpleTypeModelBinder.cs (1)
97bindingContext.ModelState.TryAddModelError(
ModelBinding\Binders\TryParseModelBinder.cs (1)
101bindingContext.ModelState.TryAddModelError(
Microsoft.AspNetCore.Mvc.NewtonsoftJson (1)
NewtonsoftJsonInputFormatter.cs (1)
309context.ModelState.TryAddModelError(key, modelStateException, metadata);