What seems like a basic C# query, but I'm not a C# developer
<p>This won't make a lot of sense so apologies in advance, I'm not a C# developer but have been given some code to look at.  </p>

<p>I need to pass a model object in to a function, however I looping through and so will need to build the name dynamically. So lets assume I would normally reference it like so.</p>

<pre><code>model.employee.title
model.employee.forename
</code></pre>

<p>How can I reference it using a string for the last part.</p>

<p>I'm using a foreach to loop through the various parts which is fine, but I then need to pass the object in to a function call. I have the name of the last part as a literal string ("title","forname") but I'm not sure how I pass that in.</p>

<p>So effectively what I need is to use something like</p>

<pre><code>model.employee."title"
</code></pre>

<p>or </p>

<pre><code>model.employee.varContainingTheName
</code></pre>

<p>I know these won't work, but have no idea how to proceed. </p>
