Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>im currenctly doing this by creating a class which have all the settings as propertiese like<br></p> <pre><code>class Setting { GUID siteGuid{get; set;} //other settings } </code></pre> <p>then i created a static class <code>SettingManager</code> like this</p> <pre><code>public static class SettingManager { private ConcurrentDictionary&lt;GUID,Setting&gt; settings= new ConcurrentDictionary&lt;GUID,Setting&gt;; GetSetting(Guid siteGUID) { settings.TryGet(siteGuid); Lastrefreshed = DateTime.Now; //other code } Private DateTime LastRefreshedOn = DateTime.Now; public void PopulateSetingsDic() { //populate the settings dictionary by getting the values from the database } } </code></pre> <p><br> now anywhere in your code just include the namespace and use the settings.<br> u can populate the settings once or on every interval in <code>application_start</code> using <code>lastRefreshedOn</code> variable it will be fast because u have all the settings inside the memory.<br/><br/> also if u want that the u should be able to add the settings dynamically then u can use an <code>ExpandoObject</code> and add settings dynamically using the column names from the database or just a mapping<br> then ull be able to use the settings by casting the settings ExpandoObject to <code>IDictionary&lt;string,object&gt;</code> here string can be the string converted GUID</p> <p>Edit:- <a href="http://zippedtech.blogspot.in/2012/04/dynaminism-in-net-40.html" rel="nofollow">http://zippedtech.blogspot.in/2012/04/dynaminism-in-net-40.html</a> check the link.. i have added a new post for solution to problems like this.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload