jefffhaynes / BinarySerializer

A declarative serialization framework for controlling formatting of data at the byte and bit level using field bindings, converters, and code.
MIT License
292 stars 62 forks source link

[FEATURE REQUEST] SerializeWhen comparer operator #177

Closed sn4k3 closed 2 years ago

sn4k3 commented 2 years ago

Would be usefull to have operators on SerializeWhen or a new SerializeWhenCompare attribute

So, for example, i can have: [SerializeWhenCompare (nameof(Version), Enum.GreaterThan, 2)] which will be serialized when version is > than 2

Operators:

Enum.EqualTo
Enum.DifferentThan
Enum.LessThan
Enum.LessEqualThan
Enum.GreaterThan
Enum.GreaterEqualThan
...
jefffhaynes commented 2 years ago

Good idea