I need to store data about one article in multiple fields, 3 fields in this example:
article["title"] = "Article Title"; // string
article["description"] = "Article Description"; // string
article["total_pages"] = 15; // int
Then I need to be able to use the stored data:
int pages = article["total_pages"]; // cast not required
MessageBox.Show(pages.ToString());
MessageBox.Show(article["title"]);
Question:
What would be the proper way of storing data like this?
I could simply create variables like string article_title, string article_description, int article_total_pages but if the article actually has more than 10 fields, then the code gets quite messy.
Edit:
It's fine if all fields can be defined somewhere in one place. What I need is to be able to have a clean code when I use these data in the program.
E.g. Article["Title"] or Article.Title (very clean usage)