This change allow re-use existing elements in target list when destination primary key is not exposed by DTO.
Method relies on index in the list instead so:
when data is not modified delete and insert queries are not executed.
when data is modified only update statement is performed
when element is append to collection insert query is performed only for last item
when element is removed from collection last element, delete is performed for last item from collection and update are performed for all items that were placed after removed
when element is inserted into list at position n, insert is performed for last element, update is performed for elements from n to oldList.Length -1
It is not as efficient as primary-key based solution but, still improves performance when key-based solution is not feasible.
There are 2 overrides of the method:
First allow property to be any type implementing IList but, type inference does not work with it
Second restricts property to be of type IList (exactly) but, type inference works with it.
This change allow re-use existing elements in target list when destination primary key is not exposed by DTO. Method relies on index in the list instead so:
It is not as efficient as primary-key based solution but, still improves performance when key-based solution is not feasible.
There are 2 overrides of the method: