0

I'm making web project with c# mvc.

I have to make static strings (About 10 strings). These strings are used as business code in controller, so I think it can't be resources (like resx).

I thought of 2 ways:

First. create static class including static strings

public static class CodeGenerationKind
{
    public const string Collaboration = "Collaboration";

    public const string Documentation = "Documentation";

    public const string DocumentationFolder = "DocumentationFolder";

    public const string Instruction = "Instruction";
}

Second. put strings on config file

<add key="Collaboration" value="Collaboration"/>
<add key="Documentation" value="Documentation"/>
<add key="DocumentationFolder" value="DocumentationFolder"/>
<add key="Instruction" value="Instruction"/>

which one is better? If first is better, where do I put this class?

or Is there a better way?

Here is my project structure:

enter image description here

Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
yoon
  • 30
  • 3

0 Answers0