The problem is that your loop iterates two times, the first it assigns the first value to your IdOne and IdTwo properties, the second iteration overwrites both properties with the second value; due to this you've the last iteration value in your both properties. A possible solution as @user1708042 notes in the comments could be simply not iterate and set the values for your properties directly:

Another possible solutions could be to combine two lists; one with the property names and other one with the values in a Map, and then iterate over map entries setting the property name and the property values, for example: