title: Sort object that contains List and update object using LINQ
body: <p>I am writing a function to sort a <code>List</code> using a property inside the list. 
  I need to sort the <code>MyClass</code> object <code>obj</code> using the property <code>Age</code> of the list <code>AnimalList</code> and assign the sorted list back to <code>obj</code>. After performing the function <code>obj</code> should get updated with the new sorted object. My list value has got the sorted list now. I need to update that to obj.</p>
  
  <p>I have tried many possibilities but couldn't bind it the list to the object.</p>
  
  <pre><code>public void SortBlocks(MyClass obj)
  {
      List&lt;Animal&gt; value = obj.AnimalList;
      value = value.OrderBy(val =&gt; val.Age).ToList();
  }
  
  public interface MyClass 
  {
       List&lt;Animal&gt; AnimalList { get; set; }
  }
  public class Animal
  {
      public string color{get;set;}
      public uint Age{get;set;}
  }
  </code></pre>
  
  <p>Thanks in advance!</p>