Steve Dunn
Steve Dunn
Thanks for the feedback! Released in https://github.com/SteveDunn/Vogen/releases/tag/5.0.6-beta.1
Hi, thanks for the feedback. Nullable underlying primitives aren't supported. They're not explicitly unsupported, but rather by side-effect of the purpose of value objects. In an effort to make myself...
Hi again, pruning some issues. The only workaround I can suggest is to represent an error state as a predefined value, something like: ``` [ValueObject
This is the trouble with using `record`s that don't exhibit value equality. I think it should override the equality operators, or better still, swap out the `Dictionary` with a custom...
> This is the trouble with using `record`s that don't exhibit value equality. I think it should override the equality operators, or better still, swap out the `Dictionary` with a...
Collections aren't supported because they don't exhibit value semantics. For instance, a `Hash.From([1, 2, 3]) == Hash.From([1, 2, 3])` is false. Also, serialization probably wouldn't work for collections, e.g. when...
An alternative is to use a "deep-equatable" array, and have that as the underlying type for a value object. Here is such an array implementation: https://github.com/eiriktsarpalis/typeshape-csharp/blob/main/src/TypeShape.Roslyn/IncrementalTypes/ImmutableEquatableArray.cs You can then do:...
Actually, that won't work either, as it delves into the hierarchy to see if it's a collection. This works, kinda: ``` public class Hash : IEquatable where T : IEquatable...
Also, for array, I don't know what `ToString` would do by default...
After careful consideration, I've left the restriction on `ICollection`, purely because it enables an easy way to mutate the data in the value object, which Vogen goes to considerable lengths...