Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3d level association does not work. #158

Open
cryo75 opened this issue Mar 23, 2016 · 0 comments
Open

3d level association does not work. #158

cryo75 opened this issue Mar 23, 2016 · 0 comments

Comments

@cryo75
Copy link

cryo75 commented Mar 23, 2016

I have the following classes:

Customer
CustomerAddress
PostCode
State

On saving a customer with an address I do:

customer = dbContext.UpdateGraph<Customer>
            (entity, map => map.OwnedEntity(x => x.CustomerAddress, with => with.AssociatedEntity(x => x.PostCode)));   

This works because State is associated to PostCode and PostCode is associated to state.

However, when GraphDiff reloads the saved entities, the state is null. So I tried:

customer = dbContext.UpdateGraph<Customer>
            (entity, map => map.OwnedEntity(x => x.CustomerAddress, with => with.AssociatedEntity(x => x.PostCode).AssociatedEntity(x => x.PostCode.State));   

This does compile but it does not work, because it throws an exception about include paths.on other entities unrelated to the address.

Is there a way to solve this issue of associating a 3rd level?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant