andrewlock / StronglyTypedId

A Rosyln-powered generator for strongly-typed IDs
MIT License
1.52k stars 79 forks source link

Extensible Code Generation #4

Closed megakid closed 9 months ago

megakid commented 5 years ago

We use serialisers such as protobuf-net and others, it would be great if an extension point be made such as adding attributes to members (one workaround might be to add custom serialisation methods to a partial class or could we add [DataMember(Order = 1)]/[DataContract] by default).

andrewlock commented 5 years ago

Hmmm, that's an interesting one. As I understand it, these sort of structs are not supported by protobuf-net, so that one is probably a moot point?

The code assumes that types will be mutable around the elected members. Accordingly, custom structs are not supported, since they should be immutable.

With regard to other attributes, it would certainly be possible to add extra options, though as I don't use them, I'm a little hesitant to implement it myself. Happy to look at PRs of course 🙂

andrewlock commented 9 months ago

I think this is (finally) fully covered by the work in #117 which will be released soon!