guys.
I have this cenario:
<ul>
<li>
<select>
<option value="1">First Option</option>
<option value="2">Second Option</option>
<option value="3">Tirdth Option</option>
</select>
Name of Process 1
</li>
<li>
<select>
<option value="1">First Option</option>
<option value="2">Second Option</option>
<option value="3">Tirdth Option</option>
</select>
Name of Process 2
</li>
<li>
<select>
<option value="1">First Option</option>
<option value="2">Second Option</option>
<option value="3">Tirdth Option</option>
</select>
Name of Process 3
</li>
</ul>
The number of options in select block and the processes are both retrivied from a database. How can I translate it into a ViewModel property? Something like a List of Processes and a List of Options? But I want to have it into one single property. Can you help me with this?
Thanks all!
You could create a wrapper object which holds the name and an array of the options. So the class would look like:
The viewmodel would be a list of the WrapperObjects and you could loop them.