What's the best way to store a group of constants that my program uses?

Matthew picture Matthew · Nov 12, 2009 · Viewed 99.9k times · Source

I have various constants that my program uses... string's, int's,double's, etc... What is the best way to store them? I don't think I want an Enum, because the data is not all the same type, and I want to manually set each value. Should I just store them all in an empty class? Or is there a better way?

Answer

Daniel A. White picture Daniel A. White · Nov 12, 2009

You probably could have them in a static class, with static read-only properties.

public static class Routes
{
    public static string SignUp => "signup";
}