Vogen
Vogen copied to clipboard
allow to default
[ValueObject(typeof(int), Default = bool)]
So allow default for whatever reason I want. In this case, Value should be public get/set. Or will not be able to set it. Still prevent direct creation of values (so kind of only reflection can do that).
in this case it seems then resonable to impl https://docs.microsoft.com/en-us/dotnet/api/system.componentmodel.dataannotations.ivalidatableobject.validate .
so kind of can serde it from data, but reflection of serde respects validity
Apologies, I must've missed this issue. Making Value
settable violates the immutable aspect of value objects.
There are defaultable 'instances' that you can create, please see: https://github.com/SteveDunn/Vogen/wiki/Instances