This thread looks to be a little on the old side and therefore may no longer be relevant. Please see if there is a newer thread on the subject and ensure you're using the most recent build of any software if your question regards a particular product.
This thread has been locked and is no longer accepting new posts, if you have a question regarding this topic please email us at support@mindscape.co.nz
|
Hello, Please, could you explain me if there is a way in order to maintain item order of a EntityCollection into the database: I have an Entity A which contains a EntityCollection of B instances. I create a new instance A1 I create and add a new instance B1 into A EntityCollection I create and add a new instance B2 into A EntityCollection I save changes. Sometimes, B2 is persisted before B1. Any idea? Thanks in advance. Jonathan. |
|
|
We don't make any guarantees about the ordering of inserts of entities of the same type (except for certain self-join scenarios where foreign key dependencies are significant). There is no way to force entities to be inserted in a particular order except to save each new entity as you create it. Why are you concerned about the ordering of INSERT statements? Databases don't have an inherent order so if getting things out in a particular order is a concern then you should use an OrderByAttribute on the association. |
|
|
Thank you Ivan. I will use the OrderByAttribute on the association. Jonathan. |
|