Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Lazy Class Usage
Message
Information générale
Forum:
ASP.NET
Catégorie:
Code, syntaxe and commandes
Titre:
Lazy Class Usage
Divers
Thread ID:
01486990
Message ID:
01486990
Vues:
125
I have this property:
private List<MerchantLocationModel> _Locations = null;
public List<MerchantLocationModel> Locations
{
    get 
    {
        if (_Locations == null)
        {
            TDCDataProvider provider = new TDCDataProvider();
            _Locations = provider.GetMerchantLocations(RecordId);
        }

        return _Locations; 
    }
    set
    {
        if (value != _Locations)
        {
            _Locations = value;
            RaisePropertyChanged("Locations");
        }
    }
}
Can I use the new Lazy class in the getter? if so, I could use some help coding it. I don't quite understand it. Is there any benefit to sing Lazy over what I have here?
Everything makes sense in someone's mind
public class SystemCrasher :ICrashable
In addition, an integer field is not for irrational people
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform