@@ -30,12 +30,8 @@ See [wiki](https://github.com/PawelGerr/Thinktecture.Runtime.Extensions/wiki) fo
30
30
31
31
# Requirements
32
32
33
- * Version 8:
34
- * C# 11 (or higher) for generated code
35
- * SDK 8.0.400 (or higher) for building projects
36
- * Version 7:
37
- * C# 11 (or higher) for generated code
38
- * SDK 7.0.401 (or higher) for building projects
33
+ * C# 11 (or higher) for generated code
34
+ * SDK 8.0.400 (or higher) for building projects
39
35
40
36
# Migrations
41
37
@@ -299,7 +295,7 @@ Value objects help solve several common problems in software development:
299
295
4 . ** Complex Value Objects** : Encapsulate multiple related values with validation
300
296
``` csharp
301
297
[ComplexValueObject ]
302
- public sealed partial class DateRange
298
+ public partial class DateRange
303
299
{
304
300
public DateOnly Start { get ; }
305
301
public DateOnly End { get ; }
@@ -444,13 +440,12 @@ public partial record Result<T>
444
440
public record Success (T Value ) : Result <T >;
445
441
public record Failure (string Error ) : Result <T >;
446
442
447
- // Convenient implicit conversions
448
- public static implicit operator Result <T >(T value ) => new Success (value );
449
- public static implicit operator Result <T >(string error ) => new Failure (error );
443
+ // Implicit conversions from T and string are implemented automatically
450
444
}
451
445
452
446
// Usage
453
447
Result < int > result = await GetDataAsync ();
448
+
454
449
var message = result .Switch (
455
450
success : s => $" Got value: {s .Value }" ,
456
451
failure : f => $" Error: {f .Error }"
0 commit comments