Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Lazy Class Usage
Message
General information
Forum:
ASP.NET
Category:
Coding, syntax and commands
Title:
Lazy Class Usage
Miscellaneous
Thread ID:
01486990
Message ID:
01486990
Views:
126
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
Next
Reply
Map
View

Click here to load this message in the networking platform