LINQ to SQL: On load processing of lazy loaded associations

Posted by Matt Holmes on Stack Overflow See other posts from Stack Overflow or by Matt Holmes
Published on 2010-04-30T17:37:52Z Indexed on 2010/04/30 17:47 UTC
Read the original article Hit count: 298

Filed under:
|
|

If I have an object that lazy loads an association with very large objects, is there a way I can do processing at the time the lazy load occurs? I thought I could use AssociateWith or LoadWith from DataLoadOptions, but there are very, very specific restrictions on what you can do in those. Basically I need to be notified when an EntitySet<> decides it's time to load the associated object, so I can catch that event and do some processing on the loaded object. I don't want to simply walk through the EntitySet when I load the parent object, because that will force all the lazy loaded items to load (defeating the purpose of lazy loading entirely).

© Stack Overflow or respective owner

Related posts about linq-to-sql

Related posts about .NET