entity framework - Maintaining the insert order with Breeze -


edit people stumble upon question in future.

this not breeze issue, ef issue , has been asked many times on so. here , here.

i using breeze knockout. creating entities , pushing them array , when saving changes server data ends in different order how pushed on client. using web api , entity framework.

the javascript code looks this:

var owner = manager.createentity('ownerinformation'); licapp().owners.push(owner); 

before savechanges called array looks this:

enter image description here

when savechanges called savebundle looks (ommiting lot of other info brevity)

{"entities": [   {     "id": 2008,    {     "id": -3,     "licensingapplicationid": 2008,     "firstname": "first",     "lastname": "owner",   },   {     "id": -4,     "licensingapplicationid": 2008,     "firstname": "second",     "lastname": "owner",   } ]} 

but after saving database result (the first column id):

enter image description here

why being inserted backwards?

i have higher order question you. why care? you're using relational database. order not defined. if care order, data should have orderby.

i'm not trying snarky. believe expectation of save order sets failure. convince me otherwise. i'm ready learn.

p.s.: don't think breeze has ... on client or server. i'll bet you're using ef. i've never been able predict ef's save order ... nor have bothered try, given principles involved.


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

How to get multiresult with multicondition in Sql Server -