Wanted to know if it is possible to do EqualityComparison based on index of item in respective collection?
Basically, if below 2 scenarios can be accomplished or not:
Secnario 1: When srcCollection.Count > destCollection.Count
Assuming srcCollection has 3 items and destCollection has 2 items, should result into:
srcCollection[0] gets mapped to destCollection[0]
srcCollection[1] gets mapped to destCollection[1]
srcCollection[2] gets mapped into new item in destCollection at index 2
Secnario 2: When srcCollection.Count < destCollection.Count
Assuming srcCollection has 2 items and destCollection has 3 items, should result into:
srcCollection[0] gets mapped to destCollection[0]
srcCollection[1] gets mapped to destCollection[1]
Item in destCollection at index 2 gets removed
Actually, my srcCollection is property of the ViewModel coming from client-side and items in it need to be mapped onto the destCollection (which is property of the Domain model) on the server-side. The srcCollection contains objects that do not have any Id because it was not exposed to client-side in the first place.
Hello,
Wanted to know if it is possible to do EqualityComparison based on index of item in respective collection?
Basically, if below 2 scenarios can be accomplished or not:
Secnario 1: When srcCollection.Count > destCollection.Count Assuming srcCollection has 3 items and destCollection has 2 items, should result into: srcCollection[0] gets mapped to destCollection[0] srcCollection[1] gets mapped to destCollection[1] srcCollection[2] gets mapped into new item in destCollection at index 2
Secnario 2: When srcCollection.Count < destCollection.Count Assuming srcCollection has 2 items and destCollection has 3 items, should result into: srcCollection[0] gets mapped to destCollection[0] srcCollection[1] gets mapped to destCollection[1] Item in destCollection at index 2 gets removed
Actually, my srcCollection is property of the ViewModel coming from client-side and items in it need to be mapped onto the destCollection (which is property of the Domain model) on the server-side. The srcCollection contains objects that do not have any Id because it was not exposed to client-side in the first place.