title: Retrieve distinct element value from a List
body: <p>I have a <code>List&lt;Animal&gt;</code> , which contains 100s of objects. There'll be a field which is <code>AnimalType</code> that will be common. I need to fetch 
  this value.</p>
  
  <pre><code>            List&lt;Animal&gt; foundAnimal = db.Animals
                  .Where(a =&gt; a.Name == "Elephant"
                      )).ToList();
  </code></pre>
  
  <p>The <code>foundAnimal</code> object has a element called <code>AnimalType</code> (Which is an <code>int</code>) which is the same for all "Elephants". I need to retrieve this value from the above
  List. </p>
  
  <p>How can I do that ?</p>
  
  <p><strong>Animal object</strong></p>
  
  <pre><code>private string Name {get;set}
  private int Age{get;set}
  private int AnimalType{get;set}
  </code></pre>
  
  <p>What I tried:</p>
  
  <pre><code>var ani = foundAnimal.Distinct();
  </code></pre>
  
  <p>But the above gives me a list of Distinct Animal objects. What I need to know is the value that is common in the Animal Object (for the name Elephant) 
  which is a <code>int</code> value.</p>
  
  <p>UPDATE</p>
  
  <pre><code>new Animal {Name = "Elephant" , Age 12 , AnimalType = 1 } 
  new Animal {Name = "Elephant" , Age 12 , AnimalType = 1 } 
  new Animal {Name = "Elephant" , Age 12 , AnimalType = 1 } 
  new Animal {Name = "Ant" , Age 12 , AnimalType = 2 } 
  new Animal {Name = "Ant" , Age 12 , AnimalType = 2 } 
  new Animal {Name = "Elephant" , Age 12 , AnimalType = 1 } 
  new Animal {Name = "Elephant" , Age 12 , AnimalType = 1 } 
  new Animal {Name = "Elephant" , Age 12 , AnimalType = 1 } 
  </code></pre>
  
  <p>The list will give me Animals where Name is Elephant</p>
  
  <pre><code>List&lt;Animal&gt; foundAnimal = db.Animals
              .Where(a =&gt; a.Name == "Elephant"
                  )).ToList();
  </code></pre>
  
  <p>The above Will return Only Objects where the Name is equal to Elephant.</p>
  
  <p>All what I need is to get the <code>AnimalType</code> which is <code>1</code> when Name == Elephant. </p>
  
  <p>Hope I was able to explain this clearly.</p>