Late eager loading of a record using load() method in LINQ


/ Published in: C#
Save to your folder(s)



Copy this code and paste it in your HTML
  1. var addresses = from a in context.Addresses select a;
  2. foreach (var address in addresses)
  3. {
  4. if (address.CountryRegion != null)
  5. {
  6. if (address.CountryRegion.Trim() == "UK")
  7. {
  8. address.ContactReference.Load();
  9. }
  10. }
  11. }

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.