|
This is WPF application. Since I'm using a Repository from Cocktail, all the repository methods do queries ASync. But I have overriden the DefaultEntityReferenceStrategy property and set it to NOT use async when fetching navigational properties.
And no, the entity I'm getting back is not a NullEntity because all the fields are populated from the database as I would expect, it's just the EntityState is saying it's Detached.
Also, if I fetch my main entity using the Repository and put an Include on it, the related Entity comes back as expected (not a NullEntity) but it is still Detached. It doesn't appear to make any difference whether you get the related entity via an Include or reference it by lazy loading.
Ultimately, I want to change my application to fetch all navigational properties using Async also. Unfortunately, we have a lot of UI that is referencing a navigational property in the UI bindings via a path (i.e. Entity.TaskSchedule.Name). TaskSchedule in this case is a navigational property. When fetched Async, TaskSchedule comes back as a PendingEntity and the binding will show Name as blank initially. I can't seem to get the UI to refresh properly when the PendingEntity is finally complete which is why I switched all the Navigation properties to fetch syncronously.
Do you have an example of how to use the Repositories to fetch navigational properties?
Thanks!
|