1 write to ErrorMessage
Microsoft.AspNetCore.Mvc.Abstractions (1)
ModelBinding\ModelError.cs (1)
38
ErrorMessage
= errorMessage ?? string.Empty;
252 references to ErrorMessage
FormatterWebSite (6)
Controllers\ValidationController.cs (5)
16
return Content(ModelState["Id"].Errors[0].
ErrorMessage
+ "," +
17
ModelState["Name"].Errors[0].
ErrorMessage
+ "," +
18
ModelState["Alias"].Errors[0].
ErrorMessage
+ "," +
19
ModelState["Designation"].Errors[0].
ErrorMessage
);
53
return ModelState["Name"].Errors[0].
ErrorMessage
;
ValidateBodyParameterAttribute.cs (1)
32
Errors = parameterBindingErrors.Select(x => x.
ErrorMessage
).ToList(),
Microsoft.AspNetCore.Mvc.Abstractions (1)
ModelBinding\Metadata\ModelBindingMessageProvider.cs (1)
75
/// <see cref="ModelError"/>s have <c>null</c> <see cref="ModelError.
ErrorMessage
"/>s.
Microsoft.AspNetCore.Mvc.Abstractions.Test (21)
ModelBinding\ModelStateDictionaryTest.cs (21)
316
Assert.Equal("some error", error.
ErrorMessage
);
338
Assert.Equal("some error", kvp.Value.Errors[0].
ErrorMessage
);
574
error => Assert.Equal("value2-Error1", error.
ErrorMessage
));
607
error => Assert.Equal("value2-Error1", error.
ErrorMessage
));
659
Assert.Equal("some error", modelState.Errors[0].
ErrorMessage
);
877
Assert.Equal("error3", error.
ErrorMessage
);
987
Assert.Equal(expected, error.
ErrorMessage
);
1013
Assert.Equal(expected, error.
ErrorMessage
);
1041
Assert.Equal(expected, error.
ErrorMessage
);
1067
Assert.Equal(expected, error.
ErrorMessage
);
1101
Assert.Equal(expected, error.
ErrorMessage
);
1128
Assert.Equal(expected, error.
ErrorMessage
);
1157
Assert.Equal(expected, error.
ErrorMessage
);
1184
Assert.Equal(expected, error.
ErrorMessage
);
1201
Assert.Empty(error.
ErrorMessage
);
1219
Assert.Equal(expectedMessage, error.
ErrorMessage
);
1237
Assert.Equal(expectedMessage, error.
ErrorMessage
);
1257
Assert.Equal(expectedMessage, error.
ErrorMessage
);
1277
Assert.Equal(expectedMessage, error.
ErrorMessage
);
1443
error => Assert.Equal("Property2[Property3] invalid.", error.
ErrorMessage
));
1563
error => Assert.Equal("Property2[Property3] invalid.", error.
ErrorMessage
));
Microsoft.AspNetCore.Mvc.Core (4)
SerializableError.cs (2)
46
return string.IsNullOrEmpty(error.
ErrorMessage
) ?
47
Resources.SerializableError_DefaultError : error.
ErrorMessage
;
ValidationProblemDetails.cs (2)
67
return string.IsNullOrEmpty(error.
ErrorMessage
) ?
69
error.
ErrorMessage
;
Microsoft.AspNetCore.Mvc.Core.Test (113)
ControllerBaseTest.cs (3)
2712
Assert.Equal("some error", error.
ErrorMessage
);
3118
Assert.Equal("Out of range!", error.
ErrorMessage
);
3155
Assert.Equal("Out of range!", error.
ErrorMessage
);
Controllers\ControllerBinderDelegateProviderTest.cs (3)
419
controllerContext.ModelState["memberName"].Errors.Single().
ErrorMessage
);
515
controllerContext.ModelState["memberName"].Errors.Single().
ErrorMessage
);
1246
Assert.Equal("Some error", error.
ErrorMessage
);
Formatters\SystemTextJsonInputFormatterTest.cs (5)
85
Assert.StartsWith("''' is an invalid start of a value", error.
ErrorMessage
);
107
Assert.Equal("The supplied value is invalid.", error.
ErrorMessage
);
128
Assert.Equal("The supplied value is invalid.", error.
ErrorMessage
);
158
Assert.Equal(expectedMessage, modelError.
ErrorMessage
);
181
Assert.Empty(modelError.
ErrorMessage
);
ModelBinding\Binders\ArrayModelBinderTest.cs (1)
121
Assert.Equal("A value for the 'fieldName' parameter or property was not provided.", error.
ErrorMessage
);
ModelBinding\Binders\BodyModelBinderTests.cs (6)
155
Assert.Equal("Customized error message", entry.Value.Errors.Single().
ErrorMessage
);
277
var errorMessage = Assert.Single(entry.Value.Errors).
ErrorMessage
;
320
var errorMessage = Assert.Single(entry.Value.Errors).
ErrorMessage
;
351
Assert.NotEmpty(entry.Value.Errors[0].
ErrorMessage
);
391
var errorMessage = Assert.Single(entry.Value.Errors).
ErrorMessage
;
422
Assert.NotEmpty(entry.Value.Errors[0].
ErrorMessage
);
ModelBinding\Binders\ByteArrayModelBinderTests.cs (1)
78
Assert.Equal(expected, error.
ErrorMessage
);
ModelBinding\Binders\CollectionModelBinderTest.cs (1)
307
Assert.Equal("A value for the 'fieldName' parameter or property was not provided.", error.
ErrorMessage
);
ModelBinding\Binders\ComplexObjectModelBinderTest.cs (8)
319
Assert.Equal("A value for the 'fieldName' parameter or property was not provided.", error.
ErrorMessage
);
363
Assert.Equal("A value for the 'fieldName' parameter or property was not provided.", error.
ErrorMessage
);
407
Assert.Equal("A value for the 'fieldName' parameter or property was not provided.", error.
ErrorMessage
);
623
Assert.NotNull(modelError.
ErrorMessage
);
624
Assert.Equal("A value for the 'Age' parameter or property was not provided.", modelError.
ErrorMessage
);
688
Assert.NotNull(modelError.
ErrorMessage
);
689
Assert.Equal("A value for the 'Age' parameter or property was not provided.", modelError.
ErrorMessage
);
728
Assert.Equal(string.Empty, modelError.
ErrorMessage
);
ModelBinding\Binders\ComplexTypeModelBinderTest.cs (8)
379
Assert.Equal("A value for the 'fieldName' parameter or property was not provided.", error.
ErrorMessage
);
423
Assert.Equal("A value for the 'fieldName' parameter or property was not provided.", error.
ErrorMessage
);
467
Assert.Equal("A value for the 'fieldName' parameter or property was not provided.", error.
ErrorMessage
);
801
Assert.NotNull(modelError.
ErrorMessage
);
802
Assert.Equal("A value for the 'Age' parameter or property was not provided.", modelError.
ErrorMessage
);
835
Assert.NotNull(modelError.
ErrorMessage
);
836
Assert.Equal("A value for the 'Age' parameter or property was not provided.", modelError.
ErrorMessage
);
872
Assert.Equal(string.Empty, modelError.
ErrorMessage
);
ModelBinding\Binders\DateTimeModelBinderTest.cs (3)
50
Assert.Equal(message, error.
ErrorMessage
);
72
Assert.Equal("The value '2020-08-not-a-date' is not valid.", error.
ErrorMessage
, StringComparer.Ordinal);
128
Assert.Equal(message, error.
ErrorMessage
, StringComparer.Ordinal);
ModelBinding\Binders\DictionaryModelBinderTest.cs (1)
493
Assert.Equal("A value for the 'fieldName' parameter or property was not provided.", error.
ErrorMessage
);
ModelBinding\Binders\EnumTypeModelBinderTest.cs (3)
44
Assert.Equal(message, error.
ErrorMessage
);
149
Assert.Equal(message, error.
ErrorMessage
);
232
Assert.Equal(message, error.
ErrorMessage
);
ModelBinding\Binders\FloatingPointTypeModelBinderTestOfT.cs (6)
72
Assert.Equal(message, error.
ErrorMessage
);
95
Assert.Equal("The value '12_5' is not valid.", error.
ErrorMessage
, StringComparer.Ordinal);
119
Assert.Equal("The value ' 12' is not valid.", error.
ErrorMessage
, StringComparer.Ordinal);
143
Assert.Equal("The value '12.5' is not valid.", error.
ErrorMessage
, StringComparer.Ordinal);
167
Assert.Equal("The value '32,000' is not valid.", error.
ErrorMessage
, StringComparer.Ordinal);
209
Assert.Equal(message, error.
ErrorMessage
, StringComparer.Ordinal);
ModelBinding\Binders\HeaderModelBinderTests.cs (3)
295
Assert.Equal($"The value '{headerValue}' is not valid.", error.
ErrorMessage
);
319
Assert.Equal($"The value '{headerValues[0]}' is not valid.", entry.Errors[0].
ErrorMessage
);
320
Assert.Equal($"The value '{headerValues[1]}' is not valid.", entry.Errors[1].
ErrorMessage
);
ModelBinding\Binders\KeyValuePairModelBinderTest.cs (2)
33
Assert.Equal("A value is required.", error.
ErrorMessage
);
59
Assert.Equal("A value is required.", error.
ErrorMessage
);
ModelBinding\Binders\SimpleTypeModelBinderTest.cs (4)
130
Assert.Equal("The value '' is invalid.", error.
ErrorMessage
, StringComparer.Ordinal);
155
Assert.Equal(message, error.
ErrorMessage
);
331
Assert.Equal("The value '32,000' is not valid.", error.
ErrorMessage
);
376
Assert.Equal("The value '12,5' is not valid.", error.
ErrorMessage
, StringComparer.Ordinal);
ModelBinding\Binders\TryParseTypeModelBinderTest.cs (6)
79
Assert.Equal("The value '' is invalid.", error.
ErrorMessage
, StringComparer.Ordinal);
104
Assert.Equal(message, error.
ErrorMessage
);
257
Assert.Equal("The value '32,000' is not valid.", error.
ErrorMessage
);
302
Assert.Equal("The value '12-5' is not valid.", error.
ErrorMessage
, StringComparer.Ordinal);
407
Assert.Equal($"The value '{flagsEnumValue}' is not valid.", error.
ErrorMessage
, StringComparer.Ordinal);
457
Assert.Equal($"The value '{value}' is not valid.", error.
ErrorMessage
, StringComparer.Ordinal);
ModelBinding\ModelBindingHelperTest.cs (1)
85
Assert.Equal(ValidationAttributeUtil.GetRequiredErrorMessage("MyProperty"), error.
ErrorMessage
);
ModelBinding\ParameterBinderTest.cs (12)
82
actionContext.ModelState.Single().Value.Errors.Single().
ErrorMessage
);
120
actionContext.ModelState.Single().Value.Errors.Single().
ErrorMessage
);
220
Assert.Equal(attribute.FormatErrorMessage(expectedFieldName), error.
ErrorMessage
);
258
actionContext.ModelState.Single().Value.Errors.Single().
ErrorMessage
);
299
actionContext.ModelState.Single().Value.Errors.Single().
ErrorMessage
);
354
Assert.Equal("The DerivedProperty field is required.", error.
ErrorMessage
);
409
Assert.Equal("Always Invalid", error.
ErrorMessage
);
464
Assert.Equal("The DerivedProperty field is required.", error.
ErrorMessage
);
518
Assert.Equal("Always Invalid", error.
ErrorMessage
);
577
Assert.Equal("This is not valid.", error.
ErrorMessage
);
638
Assert.Equal("This is also not valid.", error.
ErrorMessage
);
645
Assert.Equal("This is not valid.", error.
ErrorMessage
);
ModelBinding\Validation\DefaultObjectValidatorTests.cs (36)
240
Assert.Equal(ValidationAttributeUtil.GetRequiredErrorMessage("Name"), error.
ErrorMessage
);
245
Assert.Equal(ValidationAttributeUtil.GetRequiredErrorMessage("Profession"), error.
ErrorMessage
);
316
var errorMessages = entry.Errors.Select(e => e.
ErrorMessage
);
348
var errorMessages = entry.Errors.Select(e => e.
ErrorMessage
);
382
Assert.Equal(ValidationAttributeUtil.GetRequiredErrorMessage("Profession"), error.
ErrorMessage
);
387
Assert.Equal(ValidationAttributeUtil.GetRequiredErrorMessage("Name"), error.
ErrorMessage
);
392
Assert.Equal(ValidationAttributeUtil.GetRequiredErrorMessage("Profession"), error.
ErrorMessage
);
419
Assert.Equal("User object lacks some data.", error.
ErrorMessage
);
425
Assert.Equal("User object lacks some data.", error.
ErrorMessage
);
453
Assert.Equal("User object lacks some data.", error.
ErrorMessage
);
459
Assert.Equal("User object lacks some data.", error.
ErrorMessage
);
492
Assert.Equal("Error1 about '' (display: 'ValidatableModel').", error.
ErrorMessage
);
497
Assert.Equal("Error2", error.
ErrorMessage
);
502
Assert.Equal("Error3", error.
ErrorMessage
);
507
Assert.Equal("Error3", error.
ErrorMessage
);
549
error.
ErrorMessage
);
556
Assert.Equal("Error2", error.
ErrorMessage
);
563
Assert.Equal("Error3", error.
ErrorMessage
);
570
Assert.Equal("Error3", error.
ErrorMessage
);
673
Assert.Equal(error.
ErrorMessage
, ValidationAttributeUtil.GetRequiredErrorMessage("Profession"));
709
Assert.Equal(error.
ErrorMessage
, ValidationAttributeUtil.GetRequiredErrorMessage("Profession"));
806
Assert.Equal(ValidationAttributeUtil.GetRequiredErrorMessage("Name"), error.
ErrorMessage
);
811
Assert.Equal(ValidationAttributeUtil.GetRequiredErrorMessage("Profession"), error.
ErrorMessage
);
816
Assert.Equal(ValidationAttributeUtil.GetRequiredErrorMessage("Name"), error.
ErrorMessage
);
821
Assert.Equal(ValidationAttributeUtil.GetRequiredErrorMessage("Profession"), error.
ErrorMessage
);
849
Assert.Equal(ValidationAttributeUtil.GetRequiredErrorMessage("Name"), error.
ErrorMessage
);
854
Assert.Equal(ValidationAttributeUtil.GetRequiredErrorMessage("Profession"), error.
ErrorMessage
);
859
Assert.Equal(ValidationAttributeUtil.GetRequiredErrorMessage("Name"), error.
ErrorMessage
);
864
Assert.Equal(ValidationAttributeUtil.GetRequiredErrorMessage("Profession"), error.
ErrorMessage
);
965
Assert.Equal("Collection contains duplicate value 'Joe'.", error.
ErrorMessage
);
971
Assert.Equal("Collection contains duplicate value 'Joe'.", error.
ErrorMessage
);
1063
Assert.Equal(error.
ErrorMessage
, ValidationAttributeUtil.GetRequiredErrorMessage("Name"));
1068
Assert.Equal(error.
ErrorMessage
, ValidationAttributeUtil.GetRequiredErrorMessage("Profession"));
1073
Assert.Equal(error.
ErrorMessage
, ValidationAttributeUtil.GetRequiredErrorMessage("Name"));
1078
Assert.Equal(error.
ErrorMessage
, ValidationAttributeUtil.GetRequiredErrorMessage("Profession"));
1257
Assert.Equal("1", error.
ErrorMessage
);
Microsoft.AspNetCore.Mvc.IntegrationTests (79)
ActionParametersIntegrationTest.cs (5)
798
var message = entry.Errors.Single().
ErrorMessage
;
838
var message = entry.Errors.Single().
ErrorMessage
;
843
message = entry.Errors.Single().
ErrorMessage
;
883
var message = entry.Errors.Single().
ErrorMessage
;
888
message = entry.Errors.Single().
ErrorMessage
;
BindPropertyIntegrationTest.cs (1)
295
var message = testContext.ModelState[propertyName].Errors.Single().
ErrorMessage
;
BodyValidationIntegrationTests.cs (6)
392
Assert.Equal(addressRequired, error.
ErrorMessage
);
483
Assert.Equal("A non-empty request body is required.", error.
ErrorMessage
);
595
Assert.Empty(error.
ErrorMessage
);
645
Assert.NotEmpty(error.
ErrorMessage
);
739
Assert.Equal(streetRequired, error.
ErrorMessage
);
903
errorMessage = errorMessage + error.
ErrorMessage
;
CollectionModelBinderIntegrationTest.cs (4)
332
Assert.Equal("A value for the 'Name' parameter or property was not provided.", error.
ErrorMessage
);
338
Assert.Equal("A value for the 'Name' parameter or property was not provided.", error.
ErrorMessage
);
680
Assert.Equal(ValidationAttributeUtil.GetStringLengthErrorMessage(null, 3, "Street"), error.
ErrorMessage
);
720
Assert.Equal(ValidationAttributeUtil.GetStringLengthErrorMessage(null, 3, "Street"), error.
ErrorMessage
);
ComplexRecordIntegrationTest.cs (12)
1995
Assert.Equal("A value for the 'Customer' parameter or property was not provided.", error.
ErrorMessage
);
2051
Assert.Equal("Hurts when 'Customer' is not provided.", error.
ErrorMessage
);
2109
Assert.Equal("A value for the 'Name' parameter or property was not provided.", error.
ErrorMessage
);
2163
Assert.Equal("A value for the 'Name' parameter or property was not provided.", error.
ErrorMessage
);
2221
Assert.Equal("A value for the 'Name' parameter or property was not provided.", error.
ErrorMessage
);
2271
Assert.Equal("A value for the 'ProductName' parameter or property was not provided.", error.
ErrorMessage
);
2323
Assert.Equal("A value for the 'ProductName' parameter or property was not provided.", error.
ErrorMessage
);
2419
Assert.Equal("A value for the 'OrderIds' parameter or property was not provided.", error.
ErrorMessage
);
2471
Assert.Equal("A value for the 'OrderIds' parameter or property was not provided.", error.
ErrorMessage
);
2570
Assert.Equal("The value '' is invalid.", error.
ErrorMessage
);
2620
Assert.Equal("The value '' is invalid.", error.
ErrorMessage
, StringComparer.Ordinal);
4200
Assert.Equal("A value for the 'Name' parameter or property was not provided.", error.
ErrorMessage
);
ComplexTypeIntegrationTestBase.cs (11)
2149
Assert.Equal("A value for the 'Customer' parameter or property was not provided.", error.
ErrorMessage
);
2204
Assert.Equal("Hurts when 'Customer' is not provided.", error.
ErrorMessage
);
2271
Assert.Equal("A value for the 'Name' parameter or property was not provided.", error.
ErrorMessage
);
2325
Assert.Equal("A value for the 'Name' parameter or property was not provided.", error.
ErrorMessage
);
2383
Assert.Equal("A value for the 'Name' parameter or property was not provided.", error.
ErrorMessage
);
2437
Assert.Equal("A value for the 'ProductName' parameter or property was not provided.", error.
ErrorMessage
);
2489
Assert.Equal("A value for the 'ProductName' parameter or property was not provided.", error.
ErrorMessage
);
2589
Assert.Equal("A value for the 'OrderIds' parameter or property was not provided.", error.
ErrorMessage
);
2641
Assert.Equal("A value for the 'OrderIds' parameter or property was not provided.", error.
ErrorMessage
);
2743
Assert.Equal("The value '' is invalid.", error.
ErrorMessage
);
2793
Assert.Equal("The value '' is invalid.", error.
ErrorMessage
, StringComparer.Ordinal);
DictionaryModelBinderIntegrationTest.cs (7)
816
Assert.Equal("You're out of range.", error.
ErrorMessage
);
1333
Assert.Equal("The value '' is invalid.", Assert.Single(kvp.Value.Errors).
ErrorMessage
);
1349
Assert.Equal("The Name field is required.", Assert.Single(kvp.Value.Errors).
ErrorMessage
);
1387
Assert.Equal("Invalid is not a valid value for DayOfWeek.", modelState["parameter"].Errors[0].
ErrorMessage
);
1425
Assert.Equal("The value 'BadEnumValue' is not valid for Value.", modelState["parameter[exclamation]"].Errors[0].
ErrorMessage
);
1486
Assert.Equal("The value '' is invalid.", Assert.Single(kvp.Value.Errors).
ErrorMessage
);
1502
Assert.Equal("The Name field is required.", Assert.Single(kvp.Value.Errors).
ErrorMessage
);
HeaderModelBinderIntegrationTest.cs (1)
63
Assert.Equal(expected, error.
ErrorMessage
);
KeyValuePairModelBinderIntegrationTest.cs (4)
82
Assert.Equal("A value is required.", error.
ErrorMessage
);
132
Assert.Equal("Hurts when nothing is provided.", error.
ErrorMessage
);
174
Assert.Equal("A value is required.", error.
ErrorMessage
);
224
Assert.Equal("Hurts when nothing is provided.", error.
ErrorMessage
);
NullableReferenceTypeIntegrationTest.cs (1)
144
Assert.Equal("Test", error.
ErrorMessage
);
SimpleTypeModelBinderIntegrationTest.cs (4)
406
Assert.Equal("The value 'abcd' is not valid.", error.
ErrorMessage
);
466
Assert.Equal($"Hmm, 'abcd' is not a valid value.", error.
ErrorMessage
);
507
Assert.Equal("The value '' is invalid.", error.
ErrorMessage
, StringComparer.Ordinal);
561
Assert.Equal("Hurts when '' is provided.", error.
ErrorMessage
, StringComparer.Ordinal);
TryValidateModelIntegrationTest.cs (1)
234
errorMessage = errorMessage + error.
ErrorMessage
;
ValidationIntegrationTests.cs (11)
118
Assert.Equal(ValidationAttributeUtil.GetRangeErrorMessage(25, 50, "AccountId"), error.
ErrorMessage
);
752
Assert.Equal("Too Long.", error.
ErrorMessage
);
840
Assert.Equal("Too Long.", error.
ErrorMessage
);
979
Assert.Equal("Invalid Person.", error.
ErrorMessage
);
1087
Assert.Equal("Invalid Product.", error.
ErrorMessage
);
1170
Assert.Equal("Too Long.", error.
ErrorMessage
);
1251
Assert.Equal("The value 'bill' is not valid for Id.", error.
ErrorMessage
);
1291
Assert.Equal("The value '-123' is not valid for Zip.", error.
ErrorMessage
);
1383
error.
ErrorMessage
);
1430
error.
ErrorMessage
);
2572
Assert.Equal(ValidationAttributeUtil.GetRequiredErrorMessage(key), error.
ErrorMessage
);
ValidationWithRecordIntegrationTests.cs (11)
110
Assert.Equal(ValidationAttributeUtil.GetRangeErrorMessage(25, 50, "AccountId"), error.
ErrorMessage
);
635
Assert.Equal("Too Long.", error.
ErrorMessage
);
716
Assert.Equal("Too Long.", error.
ErrorMessage
);
848
Assert.Equal("Invalid Person.", error.
ErrorMessage
);
949
Assert.Equal("Invalid Product.", error.
ErrorMessage
);
1028
Assert.Equal("Too Long.", error.
ErrorMessage
);
1103
Assert.Equal("The value 'bill' is not valid.", error.
ErrorMessage
);
1143
Assert.Equal("The value '-123' is not valid.", error.
ErrorMessage
);
1227
error.
ErrorMessage
);
1274
error.
ErrorMessage
);
2458
Assert.Equal(ValidationAttributeUtil.GetRequiredErrorMessage(key), error.
ErrorMessage
);
Microsoft.AspNetCore.Mvc.NewtonsoftJson.Test (13)
JsonPatchExtensionsTest.cs (3)
27
Assert.Equal("The target location specified by path segment 'CustomerId' was not found.", error.
ErrorMessage
);
45
Assert.Equal("The target location specified by path segment 'CustomerId' was not found.", error.
ErrorMessage
);
89
Assert.Equal(error, modelState.First().Value.Errors.First().
ErrorMessage
);
NewtonsoftJsonInputFormatterTest.cs (9)
172
var message = formatterContext.ModelState.Values.First().Errors[0].
ErrorMessage
;
251
Assert.Equal(expectedMessage, modelError.
ErrorMessage
);
277
Assert.StartsWith("Could not convert string to integer:", error.
ErrorMessage
);
283
Assert.StartsWith("Could not convert string to integer:", error.
ErrorMessage
);
307
Assert.Empty(modelError.
ErrorMessage
);
340
Assert.NotEmpty(modelError.
ErrorMessage
);
371
Assert.Equal("The supplied value is invalid.", modelError.
ErrorMessage
);
402
Assert.Equal("The supplied value is invalid for ShortValue.", modelError.
ErrorMessage
);
433
Assert.Equal("The supplied value is invalid for ShortValue.", modelError.
ErrorMessage
);
NewtonsoftJsonPatchInputFormatterTest.cs (1)
219
Assert.Contains(exceptionMessage, formatterContext.ModelState[""].Errors[0].
ErrorMessage
);
Microsoft.AspNetCore.Mvc.RazorPages.Test (3)
Infrastructure\PageBinderFactoryTest.cs (1)
751
Assert.Equal("Some error", error.
ErrorMessage
);
PageModelTest.cs (1)
1777
Assert.Equal("some error", error.
ErrorMessage
);
PageTest.cs (1)
1855
Assert.Equal("some error", error.
ErrorMessage
);
Microsoft.AspNetCore.Mvc.ViewFeatures (5)
DefaultHtmlGenerator.cs (1)
746
modelError = modelErrors.FirstOrDefault(m => !string.IsNullOrEmpty(m.
ErrorMessage
)) ?? modelErrors[0];
ValidationHelpers.cs (4)
15
if (!string.IsNullOrEmpty(modelError.
ErrorMessage
))
17
return modelError.
ErrorMessage
;
33
if (!string.IsNullOrEmpty(modelError.
ErrorMessage
))
35
return modelError.
ErrorMessage
;
Microsoft.AspNetCore.Mvc.ViewFeatures.Test (4)
ModelStateDictionaryExtensionsTest.cs (4)
22
Assert.Equal("Message", modelError.
ErrorMessage
);
39
Assert.Equal("Message", modelError.
ErrorMessage
);
56
Assert.Equal("Message", modelError.
ErrorMessage
);
74
Assert.Equal("Message", modelError.
ErrorMessage
);
XmlFormattersWebSite (3)
Controllers\HomeController.cs (1)
40
errors.Select(modelError => $"ErrorMessage:{modelError.
ErrorMessage
};Exception:{modelError.Exception}")));
Controllers\ValidationController.cs (2)
38
if (string.IsNullOrEmpty(modelError.
ErrorMessage
))
47
errorMessage = modelError.
ErrorMessage
;