63 references to TryValidateObject
Microsoft.AspNetCore.Components.Forms (1)
EditContextDataAnnotationsExtensions.cs (1)
114
Validator.
TryValidateObject
(_editContext.Model, validationContext, validationResults, true);
Microsoft.Extensions.Options.DataAnnotations (1)
DataAnnotationValidateOptions.cs (1)
85
bool res = Validator.
TryValidateObject
(options, new ValidationContext(options), results, validateAllProperties: true);
Shared.Tests (60)
Data.Validation\LengthAttributeTests.cs (34)
34
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
39
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
46
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
53
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
60
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
67
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
90
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
95
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
102
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
109
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
117
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
124
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
161
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
168
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
178
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
186
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
196
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
218
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
222
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
229
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
234
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
241
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
268
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
275
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
285
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
293
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
303
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
343
Assert.Throws<InvalidOperationException>(() => _ = Validator.
TryValidateObject
(options0, context, results, true));
348
Assert.Throws<InvalidOperationException>(() => _ = Validator.
TryValidateObject
(options1, context, results, true));
353
Assert.Throws<InvalidOperationException>(() => _ = Validator.
TryValidateObject
(options2, context, results, true));
358
Assert.Throws<InvalidOperationException>(() => _ = Validator.
TryValidateObject
(options3, context, results, true));
363
Assert.Throws<InvalidOperationException>(() => _ = Validator.
TryValidateObject
(options4, context, results, true));
393
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
413
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
Data.Validation\TimeSpanAttributeTests.cs (26)
32
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
37
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
44
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
51
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
56
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
62
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
69
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
74
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
97
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
102
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
109
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
116
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
123
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
130
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
137
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
160
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
165
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
172
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
179
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
184
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
190
Assert.False(Validator.
TryValidateObject
(options, context, results, true));
197
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
202
Assert.True(Validator.
TryValidateObject
(options, context, results, true));
230
Assert.Throws<InvalidOperationException>(() => _ = Validator.
TryValidateObject
(options0, context, results, true));
235
Assert.Throws<InvalidOperationException>(() => _ = Validator.
TryValidateObject
(options1, context, results, true));
240
Assert.Throws<InvalidOperationException>(() => _ = Validator.
TryValidateObject
(options3, context, results, true));
System.ComponentModel.Annotations (1)
System\ComponentModel\DataAnnotations\Validator.cs (1)
97
TryValidateObject
(instance, validationContext, validationResults, validateAllProperties: false);