I am new to Linq and am struggling with what I think is a deferred execution problem. I have a data layer in my application which uses Linq to Sql and then passes the entity through to the viewmodel using a WCF service (MVVM architecture). The object gets serialised at this point.
I am passing thorough an Employee object which should have a child Rota object however when I try to access it in my view model from the WCF, Rota is null. If I view the employee object in debug prior to it being passed through then the Rota gets serialised and is available in my View Model. My Linq query is a simple select, how do I make it pass through the rota? I could loop through each employee in order to enumerate the query and rota object but this feels very wrong.