I have a c# object Design
which has DesignSection
child objects and each design section has a sequence number along with other properties. I am using automapper to map between objects and dtos.
Problem is when I map from dto to object or back the sequence number gets mixed between both DesignSection
lists. e-g
DesignDto
DesignSectionDto1 -> Sequence -> 1
DesignSectionDto2 -> Sequence -> 2
DesignSectionDto3 -> Sequence -> 3
After mapping is done, it becomes:
Design
DesignSection1 -> Sequence -> 2
DesignSection2 -> Sequence -> 3
DesignSection3 -> Sequence -> 1
I have created the maps correctly probably a small thing thats missing to retain the order of Sequence.
Any help would be appreciated.