@@ -405,10 +405,16 @@ namespace Thinktecture.Tests;
405
405
partial class TestEnum :
406
406
global::System.IParsable<global::Thinktecture.Tests.TestEnum>
407
407
{
408
+ private static global::System.ComponentModel.DataAnnotations.ValidationResult? Validate<T>(string key, global::System.IFormatProvider? provider, out global::Thinktecture.Tests.TestEnum? result)
409
+ where T : global::Thinktecture.IValueObjectFactory<global::Thinktecture.Tests.TestEnum, string>
410
+ {
411
+ return T.Validate(key, provider, out result);
412
+ }
413
+
408
414
/// <inheritdoc />
409
415
public static global::Thinktecture.Tests.TestEnum Parse(string s, global::System.IFormatProvider? provider)
410
416
{
411
- var validationResult = global::Thinktecture.Tests.TestEnum.Validate (s, provider, out var result);
417
+ var validationResult = Validate< global::Thinktecture.Tests.TestEnum> (s, provider, out var result);
412
418
413
419
if(validationResult is null)
414
420
return result!;
@@ -428,7 +434,7 @@ public static bool TryParse(
428
434
return false;
429
435
}
430
436
431
- var validationResult = global::Thinktecture.Tests.TestEnum.Validate (s, provider, out result!);
437
+ var validationResult = Validate< global::Thinktecture.Tests.TestEnum> (s, provider, out result!);
432
438
return validationResult is null;
433
439
}
434
440
}
@@ -631,10 +637,16 @@ namespace Thinktecture.Tests;
631
637
partial class TestEnum :
632
638
global::System.IParsable<global::Thinktecture.Tests.TestEnum>
633
639
{
640
+ private static global::System.ComponentModel.DataAnnotations.ValidationResult? Validate<T>(string key, global::System.IFormatProvider? provider, out global::Thinktecture.Tests.TestEnum? result)
641
+ where T : global::Thinktecture.IValueObjectFactory<global::Thinktecture.Tests.TestEnum, string>
642
+ {
643
+ return T.Validate(key, provider, out result);
644
+ }
645
+
634
646
/// <inheritdoc />
635
647
public static global::Thinktecture.Tests.TestEnum Parse(string s, global::System.IFormatProvider? provider)
636
648
{
637
- var validationResult = global::Thinktecture.Tests.TestEnum.Validate (s, provider, out var result);
649
+ var validationResult = Validate< global::Thinktecture.Tests.TestEnum> (s, provider, out var result);
638
650
return result!;
639
651
}
640
652
@@ -650,7 +662,7 @@ public static bool TryParse(
650
662
return false;
651
663
}
652
664
653
- var validationResult = global::Thinktecture.Tests.TestEnum.Validate (s, provider, out result!);
665
+ var validationResult = Validate< global::Thinktecture.Tests.TestEnum> (s, provider, out result!);
654
666
return true;
655
667
}
656
668
}
@@ -665,11 +677,17 @@ namespace Thinktecture.Tests;
665
677
partial class TestEnum :
666
678
global::System.IParsable<global::Thinktecture.Tests.TestEnum>
667
679
{
680
+ private static global::System.ComponentModel.DataAnnotations.ValidationResult? Validate<T>(int key, global::System.IFormatProvider? provider, out global::Thinktecture.Tests.TestEnum? result)
681
+ where T : global::Thinktecture.IValueObjectFactory<global::Thinktecture.Tests.TestEnum, int>
682
+ {
683
+ return T.Validate(key, provider, out result);
684
+ }
685
+
668
686
/// <inheritdoc />
669
687
public static global::Thinktecture.Tests.TestEnum Parse(string s, global::System.IFormatProvider? provider)
670
688
{
671
689
var key = int.Parse(s, provider);
672
- var validationResult = global::Thinktecture.Tests.TestEnum.Validate (key, provider, out var result);
690
+ var validationResult = Validate< global::Thinktecture.Tests.TestEnum> (key, provider, out var result);
673
691
674
692
if(validationResult is null)
675
693
return result!;
@@ -695,7 +713,7 @@ public static bool TryParse(
695
713
return false;
696
714
}
697
715
698
- var validationResult = global::Thinktecture.Tests.TestEnum.Validate (key, provider, out result!);
716
+ var validationResult = Validate< global::Thinktecture.Tests.TestEnum> (key, provider, out result!);
699
717
return validationResult is null;
700
718
}
701
719
}
@@ -2251,10 +2269,16 @@ public int CompareTo(global::TestEnum? obj)
2251
2269
partial class TestEnum :
2252
2270
global::System.IParsable<global::TestEnum>
2253
2271
{
2272
+ private static global::System.ComponentModel.DataAnnotations.ValidationResult? Validate<T>(string key, global::System.IFormatProvider? provider, out global::TestEnum? result)
2273
+ where T : global::Thinktecture.IValueObjectFactory<global::TestEnum, string>
2274
+ {
2275
+ return T.Validate(key, provider, out result);
2276
+ }
2277
+
2254
2278
/// <inheritdoc />
2255
2279
public static global::TestEnum Parse(string s, global::System.IFormatProvider? provider)
2256
2280
{
2257
- var validationResult = global::TestEnum.Validate (s, provider, out var result);
2281
+ var validationResult = Validate< global::TestEnum> (s, provider, out var result);
2258
2282
2259
2283
if(validationResult is null)
2260
2284
return result!;
@@ -2274,7 +2298,7 @@ public static bool TryParse(
2274
2298
return false;
2275
2299
}
2276
2300
2277
- var validationResult = global::TestEnum.Validate (s, provider, out result!);
2301
+ var validationResult = Validate< global::TestEnum> (s, provider, out result!);
2278
2302
return validationResult is null;
2279
2303
}
2280
2304
}
@@ -3817,10 +3841,16 @@ namespace Thinktecture.Tests;
3817
3841
partial struct TestEnum :
3818
3842
global::System.IParsable<global::Thinktecture.Tests.TestEnum>
3819
3843
{
3844
+ private static global::System.ComponentModel.DataAnnotations.ValidationResult? Validate<T>(string key, global::System.IFormatProvider? provider, out global::Thinktecture.Tests.TestEnum result)
3845
+ where T : global::Thinktecture.IValueObjectFactory<global::Thinktecture.Tests.TestEnum, string>
3846
+ {
3847
+ return T.Validate(key, provider, out result);
3848
+ }
3849
+
3820
3850
/// <inheritdoc />
3821
3851
public static global::Thinktecture.Tests.TestEnum Parse(string s, global::System.IFormatProvider? provider)
3822
3852
{
3823
- var validationResult = global::Thinktecture.Tests.TestEnum.Validate (s, provider, out var result);
3853
+ var validationResult = Validate< global::Thinktecture.Tests.TestEnum> (s, provider, out var result);
3824
3854
return result!;
3825
3855
}
3826
3856
@@ -3836,7 +3866,7 @@ public static bool TryParse(
3836
3866
return false;
3837
3867
}
3838
3868
3839
- var validationResult = global::Thinktecture.Tests.TestEnum.Validate (s, provider, out result!);
3869
+ var validationResult = Validate< global::Thinktecture.Tests.TestEnum> (s, provider, out result!);
3840
3870
return true;
3841
3871
}
3842
3872
}
0 commit comments