Skip to content

Instantly share code, notes, and snippets.

@eldewall
Created August 29, 2011 08:52
Show Gist options
  • Select an option

  • Save eldewall/1178044 to your computer and use it in GitHub Desktop.

Select an option

Save eldewall/1178044 to your computer and use it in GitHub Desktop.
nullfest
public Models.Contact CurrentUser {
get {
if (_currentContact == null) {
_currentContact = GetUser();
}
return _currentContact;
}
}
public Customer CurrentCustomer {
get {
if (_currentCustomer == null) {
_currentCustomer = CustomerFromSession();
if (_currentCustomer == null) {
_currentCustomer = CurrentUser.Customers.First();
PersistCustomer(_currentCustomer);
}
}
return _currentCustomer;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment