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

Question... using entities generated by this, navigation properties don't get populated? #4

Open
apawsey opened this issue Oct 11, 2016 · 3 comments
Assignees
Labels

Comments

@apawsey
Copy link

apawsey commented Oct 11, 2016

Hi guys,

I have a question about using these entities with breeze. The entities generated have a property with the correct array type for a navigation property. If I do a query where I include an expand clause, I can see in the query results that the associated objects are loaded, and I can also see that the root entity is loaded, and that the array property has been "attacked" by breeze (it's added a bunch of custom properties and functions to the array object).

However the contents of the array is empty. So although the correct entities have been loaded, they are not associated with the root entity correctly.

Any idea how to overcome this?

Thanks!

@marcelgood
Copy link
Collaborator

I need to know more. That's an issue with your metadata. What kind of backend are you using? And how are you creating the metadata?

@marcelgood marcelgood self-assigned this Oct 11, 2016
@apawsey
Copy link
Author

apawsey commented Oct 11, 2016

Backend is EF6, metadata is created with "standard" api endpoint...

[HttpGet]
public string Metadata()
{
      return _contextProvider.Metadata();
}

Is there perhaps a tip you can give me on where in breeze it would be looking to attach the entities? Happy to debug and try and work it out, just quicker if you can give me a pointer as to where :)

@marcelgood
Copy link
Collaborator

marcelgood commented Oct 11, 2016

Ok, something is not right with your EF model then. Breeze uses the metadata to associate entities and populate their navigation properties. The tooling just generates TypeScript classes to give you type information around the entites and allow you to extend your entities with custom code. You should see the same issue if you omit the call to the RegistrationHelper.register method and just let Breeze materialize untyped objects.

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

No branches or pull requests

2 participants