Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Newbie question on C#
Message
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Titre:
Newbie question on C#
Versions des environnements
Environment:
C# 2.0
Divers
Thread ID:
01532477
Message ID:
01532477
Vues:
124
Hi,

I am getting back to my ASP.NET application and relearning C#.

I have a class defined as PUBLIC SEALED CLASS (I think it is called static class, right?). In this class I have bunch of methods where some of them get value(s) from WEB.CONFIG using the following syntax:
string MyString = @ConfiguartionManager.AppSettings["MySetting"];
My question is, would I be better off (app runing faster) if I create a property (or a field?) in this class (correct syntax?) and store the value there (when they are retrieved the first time). And then, instead of "getting" the value from WEB.CONFIG, the value would be always available in the property or a field.

Does the above make sense? TIA.
"The creative process is nothing but a series of crises." Isaac Bashevis Singer
"My experience is that as soon as people are old enough to know better, they don't know anything at all." Oscar Wilde
"If a nation values anything more than freedom, it will lose its freedom; and the irony of it is that if it is comfort or money that it values more, it will lose that too." W.Somerset Maugham
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform