30 instantiations of ModelValidationResult
Microsoft.AspNetCore.Mvc.Core.Test (5)
ControllerBaseTest.cs (2)
3091new ModelValidationResult(string.Empty, "Out of range!") 3128new ModelValidationResult(string.Empty, "Out of range!")
Controllers\ControllerBinderDelegateProviderTest.cs (3)
392.Returns(new[] { new ModelValidationResult("memberName", "some message") }); 489.Returns(new[] { new ModelValidationResult("memberName", "some message") }); 1424yield return new ModelValidationResult(context.ModelMetadata.BinderModelName, Message);
Microsoft.AspNetCore.Mvc.DataAnnotations (4)
DataAnnotationsModelValidator.cs (2)
114var validationResult = new ModelValidationResult(newMemberName, errorMessage); 123validationResults.Add(new ModelValidationResult(memberName: null, message: errorMessage));
ValidatableObjectAdapter.cs (2)
53yield return new ModelValidationResult(memberName: null, message: result.ErrorMessage); 59yield return new ModelValidationResult(memberName, result.ErrorMessage);
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (21)
DataAnnotationsModelValidatorTest.cs (12)
65new ModelValidationResult(memberName: string.Empty, message: string.Empty), 272new[] { new ModelValidationResult(memberName: string.Empty, message: errorMessage) } }, 276new[] { new ModelValidationResult(memberName: string.Empty, message: errorMessage) } 281new[] { new ModelValidationResult(memberName: string.Empty, message: errorMessage) } 286new[] { new ModelValidationResult(memberName: string.Empty, message: errorMessage) } 292new[] { new ModelValidationResult(memberName: string.Empty, message: errorMessage) } 297new[] { new ModelValidationResult(memberName: "AnotherName", message: errorMessage) } 302new[] { new ModelValidationResult(memberName: "[1]", message: errorMessage) } 309new ModelValidationResult(memberName: "Name1", message: errorMessage), 310new ModelValidationResult(memberName: "Name2", message: errorMessage), 318new ModelValidationResult(memberName: "[0]", message: errorMessage), 319new ModelValidationResult(memberName: "[2]", message: errorMessage),
ValidatableObjectAdapterTest.cs (9)
66new[] { new ModelValidationResult(memberName: null, message: "Error message") } 70new[] { new ModelValidationResult(nameof(SampleModel.FirstName), "Error message") } 82new ModelValidationResult(memberName: null, message: "Error message1"), 83new ModelValidationResult(nameof(SampleModel.FirstName), "Error message2"), 84new ModelValidationResult(nameof(SampleModel.LastName), "Error message3"), 86new ModelValidationResult(nameof(SampleModel), "Error message4"), 101new ModelValidationResult(nameof(SampleModel.FirstName), "Error message1"), 102new ModelValidationResult(nameof(SampleModel.LastName), "Error message1"), 103new ModelValidationResult(memberName: null, message: "Error message2"),
31 references to ModelValidationResult
Microsoft.AspNetCore.Mvc.Abstractions (3)
ModelBinding\Validation\IModelValidator.cs (2)
16/// A list of <see cref="ModelValidationResult"/> indicating the results of validating the model value. 18IEnumerable<ModelValidationResult> Validate(ModelValidationContext context);
ModelBinding\Validation\ModelValidationResult.cs (1)
12/// Initializes a new instance of <see cref="ModelValidationResult"/>.
Microsoft.AspNetCore.Mvc.Core (2)
ModelBinding\Validation\ValidationVisitor.cs (2)
223var results = new List<ModelValidationResult>(); 232var result = results[i];
Microsoft.AspNetCore.Mvc.Core.Test (4)
Controllers\ControllerBinderDelegateProviderTest.cs (1)
1422public IEnumerable<ModelValidationResult> Validate(ModelValidationContext context)
ModelBinding\Metadata\DefaultValidationMetadataProviderTest.cs (2)
179public IEnumerable<ModelValidationResult> Validate(ModelValidationContext context) 200public IEnumerable<ModelValidationResult> Validate(ModelValidationContext context)
ModelBinding\Validation\DefaultModelValidatorProviderTest.cs (1)
204public IEnumerable<ModelValidationResult> Validate(ModelValidationContext context)
Microsoft.AspNetCore.Mvc.DataAnnotations (7)
DataAnnotationsModelValidator.cs (4)
50public IEnumerable<ModelValidationResult> Validate(ModelValidationContext validationContext) 99var validationResults = new List<ModelValidationResult>(); 114var validationResult = new ModelValidationResult(newMemberName, errorMessage); 129return Enumerable.Empty<ModelValidationResult>();
ValidatableObjectAdapter.cs (3)
12public IEnumerable<ModelValidationResult> Validate(ModelValidationContext context) 17return Enumerable.Empty<ModelValidationResult>(); 45private static IEnumerable<ModelValidationResult> ConvertResults(IEnumerable<ValidationResult> results)
Microsoft.AspNetCore.Mvc.DataAnnotations.Test (15)
DataAnnotationsModelValidatorTest.cs (7)
42new[] { typeof(ModelValidationResult) }); 178var validationResult = result.Single(); 233var validationResult = result.Single(); 261public static TheoryData<string, IEnumerable<string>, IEnumerable<ModelValidationResult>> 267return new TheoryData<string, IEnumerable<string>, IEnumerable<ModelValidationResult>> 331IEnumerable<ModelValidationResult> expectedResults) 390var validationResult = result.Single();
DefaultModelClientValidatorProviderTest.cs (1)
229public IEnumerable<ModelValidationResult> Validate(ModelValidationContext context)
ModelValidationResultComparer.cs (4)
8public class ModelValidationResultComparer : IEqualityComparer<ModelValidationResult> 16public bool Equals(ModelValidationResult x, ModelValidationResult y) 27public int GetHashCode(ModelValidationResult obj)
ValidatableObjectAdapterTest.cs (3)
58public static TheoryData<ValidationResult[], ModelValidationResult[]> Validate_ReturnsExpectedResultsData 62return new TheoryData<ValidationResult[], ModelValidationResult[]> 143ModelValidationResult[] expectedResults)