update destination list with entries
Issue #1
resolved
given
destination = [
{ id: 1, name = "dave", isEnabled = false },
{ id: 2, name = "bob", isEnabled = false }
]
source = [
{ id: 1, name = "dave", isEnabled = true },
{ id: 3, name = "leeloo", isEnabled = false }
]
mapper.mapTo(source, destination);
//results in
destination == [
{ id: 1, name = "dave", isEnabled = true },
{ id: 3, name = "leeloo", isEnabled = false }
]
the main thing to note
- entries have an id
- entry 1, is not replaced, it is updated, thus any object reference is up held.
- entry 2, is removed
- entry 3, is a new instance added to destination
- the list itself also retains the same instance
Comments (3)
-
reporter -
reporter -
reporter - changed status to resolved
initial version support
- Log in to comment
#4d72919