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