Breeze (1.4.5) unidirectional one-to-many: navigation collection not populated

橙三吉。 提交于 2019-12-22 18:56:10

问题


I have a model where I have a two entities, a "Parent" and a "Child".

The relationship should be obvious but goes: Parent has zero or more Child entities.

The Parent has a navigation property called "Children" with a collection of Child entities.

The Child does NOT have a navigation property back to the parent. It only has a foreign key leading back to the parent.

When I load these models into my EntityManager, the "Children" navigation property collection is only ever populated with 1 child, even though the given Parent entity in fact have several.

I have tried adding a "Parent" navigation property to the "Child" entity, and if I do this, the "Children" navigation property on the "Parent" entity is populated correctly with all Child entities when loaded in the EntityManager.

The problem is that this is not an option.

If it helps, I am not using the "Knockout" models, but rather the "backingStore" library for Angular model binding.

I have seen the question on the following link, which describes a rather similar issue (although, supposedly fixed and for a much older version of Breeze): Child entities not populated without inverse property

来源:https://stackoverflow.com/questions/20045999/breeze-1-4-5-unidirectional-one-to-many-navigation-collection-not-populated

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!