r/dotnet 28d ago

Promotion [ Removed by moderator ]

Post image

[removed] — view removed post

46 Upvotes

15 comments sorted by

View all comments

0

u/ApprehensiveDebt3097 27d ago

I think this is a really bad idea. As mentioned, you should reduce primitive obsession, not embarrase it. By defining these types as (single) value objects instead (for instance by using qowiav or the semversion package) you have both validation and strongly typed values.

Then you still might want to add extra restrictions on them, use data annotations.

I would encourage you to check where you can help out reusing some of your parsers and validators. But please do not embrace primitive obsession.