You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+21-4Lines changed: 21 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,10 +5,15 @@
5
5
6
6
A .NET source generator for creating
7
7
* Simple value objects wrapping other type(s), without the hassle of manual `Equals`/`GetHashCode`
8
-
* Value objects wrapping math primitives
9
-
* I.e. `[WrapperValueObject(typeof(int))] readonly partial struct MeterLength { }` - the type is implicitly castable to `int`, and you can create your own math operations
8
+
* Value objects wrapping math primitives and other types
9
+
* I.e. `[WrapperValueObject(typeof(int))] readonly partial struct MeterLength { }` - the type is implicitly castable to `int`
10
+
* Math and comparison operator overloads are automatically generated
11
+
*`ToString` is generated with formatting options similar to those on the primitive type, i.e. `ToString(string? format, IFormatProvider? provider)` for math types
10
12
* Strongly typed ID's
11
-
* Similar to F# `type ProductId = ProductId of Guid`, here it becomes `[WrapperValueObject] readonly partial struct ProductId { }`
13
+
* Similar to F# `type ProductId = ProductId of Guid`, here it becomes `[WrapperValueObject] readonly partial struct ProductId { }` with a `New()` function similar to `Guid.NewGuid()`
14
+
15
+
The generator targets .NET Standard 2.0 and has been tested with `netcoreapp3.1` and `net5.0` target frameworks.
16
+
The library is alpha quality.
12
17
13
18
Note that record type feature for structs is planned for C# 10, in which cases some of the
14
19
use cases this library supports will be easier to achieve without this libray.
0 commit comments