I have read lots of information about page caching and partial page caching in a MVC application. However, I would like to know how you would cache data.
In my scena
I will say implementing Singleton on this persisting data issue can be a solution for this matter in case you find previous solutions much complicated
public class GPDataDictionary
{
private Dictionary configDictionary = new Dictionary();
///
/// Configuration values dictionary
///
public Dictionary ConfigDictionary
{
get { return configDictionary; }
}
private static GPDataDictionary instance;
public static GPDataDictionary Instance
{
get
{
if (instance == null)
{
instance = new GPDataDictionary();
}
return instance;
}
}
// private constructor
private GPDataDictionary() { }
} // singleton