Nealv Nealv -4 years ago 82
C# Question

Where to store editable configuration parameters

I am building a small cms system in MVC.NET, and I have some editable variables to store. Footer information, website title etc. These are Global variables so they should only be declared once. These should be editable in the cms.

Where could I store them ? Isn't it a bit stupid to create a table for them, there they only would occupy 1 record per variable, and the variable keys should be fixed because they are used in the code.

Thanks in advance for every answer.


Answer Source

I would say in a database table is best.

As this data will be editable there is a good chance you will need lots of meta information as well, locked for edit, versions, last changed date. It is easy to add an SQL cache dependency if you use MS-SQL. It will be part of the CMS data and can be backed up in one place. Its usually safer than editing config file.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download