title: Reflection C# to idenfify and sum
body: <p>I'm trying to identify a property through reflection in c# then sum this value, but I think I'm using this in incorrect form.</p>
  
  <pre><code>var salarioTotal = 0.0;
  foreach (var item in T.GetType().GetProperties())
  {                     
    if (item.Name.ToString() == "Salario")
      salarioTotal += (Double)item.GetValue(T, null);
  
    String campo = (Convert.ToString(salarioTotal));
  
    item.SetValue(T, campo);
  }
  return T;
  </code></pre>