andrewlock / StronglyTypedId

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

Make the "Empty" field optional #55

Closed truegoodwill closed 9 months ago

truegoodwill commented 2 years ago

I had a bunch of public static readonly instances defined, and used reflection to bundle them all up into a readonly list at startup. The Empty value crept into that list by accident. I have other ways of fixing that little issue, but I thought maybe it would be a good idea to be able to suppress the Empty if someone needs to.

And since this is my first time communicating with you ... thank you Andrew, Great job :)

andrewlock commented 2 years ago

Thanks, appreciate it. I'm a little undecided on this one. There's already quite a lot of configuration options, and no doubt will be more added later. I'm not sure if the extra option is worth it in this case 🤔

andrewlock commented 9 months ago

I think I've found an answer to this in the big redesign of the library in this PR:

The main idea is to make the library much more maintainable while also giving people a mechanism to customise the generated IDs as much as they like. This will make it easy to make changes like this 🙂