Is there a "right" way to consolidate constants in C#/.NET?

This page summarizes the projects mentioned and recommended in the original post on /r/csharp

Our great sponsors
  • WorkOS - The modern identity platform for B2B SaaS
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • SaaSHub - Software Alternatives and Reviews
  • csharplang

    The official repo for the design of the C# programming language

  • C# doesn’t have built in support for enum types with string values. There is a proposal for discriminated unions (“enum classes”) that would be a potential language-supported solution lien you’re suggesting (albeit with some idiosyncrasies), but nothing currently exists for first class support.

  • SmartEnum

    A base class for quickly and easily creating strongly typed enum replacements in C#.

  • I agree SmartEnum is my go-to for this

  • WorkOS

    The modern identity platform for B2B SaaS. The APIs are flexible and easy-to-use, supporting authentication, user identity, and complex enterprise features like SSO and SCIM provisioning.

    WorkOS logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts