Breeze / breeze-client

Breeze for JavaScript clients
MIT License
38 stars 16 forks source link

Saving Entity with non-nullable navigation property on parent class #59

Open graphicsxp opened 3 years ago

graphicsxp commented 3 years ago

I'm wondering if the below scenario is the expected behavior or if I'm doing something wrong :

Let's say I have the following classes on the backend

classs Product { CategoryId : guid; Category: Category; } class Vegetable extends Product { }

Then on the client side I load a Vegetable entity without expanding Category. If I try to save the entity, breeze will raise a Validation error on the Category being required. Indeed my Category is null because I did not expand it, however my CategoryId contains a valid GUID.

Therefore shouldn't breeze let me save the entity ? It seems wrong thatI have to expand all non-nullable navigation properties for saving the main entity.