title: Is is possible to add a calculative property based on the sibling class property C#?
body: <p>I have a class of type:</p>
  <pre><code>public class sample
  {
      public int id;
      public string s;
      //Need a calculative property based on sibling value
      //Ex. public float CharRatio
  }
  </code></pre>
  <p>consider the following data set</p>
  <pre><code>List&lt;sample&gt; s = new List&lt;sample&gt;();
  s.Add(new sample{id = 1, s = &quot;source&quot;}); //id 1 is always source charRatio 100 since 6/6 in percentage
  s.Add(new sample{id = 2, s = &quot;test&quot;}); //charRatio = 66
  s.Add(new sample{id = 3, s = &quot;test&quot;}); //charRatio = 66
  s.Add(new sample{id = 4, s = &quot;test&quot;}); //charRatio = 66
  </code></pre>
  <p>Is it possible to add a calculative property to the class which will calculate a value based on the value of the sibling in a collection using LINQ/LAMBDA or any work around.
  I am trying to find a way to add charRatio which is calculated using:</p>
  <pre><code>charRatio = source.Len/test.Len
  </code></pre>
  <p>source is identified using the Id, which is always 1.
  My requirement needs it to be a calculative property so i can use it in  a expression tree.</p>