title: How to bind a Drop Down control with a collection using Query expression syntax?
body: <p>I am trying to bind a Dropdown with a collection but unable to write a proper query.</p>
  
  <p>Lets say we have Employee collection. Employee type look like as follows:</p>
  
  <pre><code>public class Employee 
  { 
      public string  Name{get;set;} 
      public List&lt;Department&gt; Department { get; set; } 
      public string Company{get;set;} 
  } 
  
  public class Department 
  { 
      public string Name { get; set; } 
      public string Location { get; set; } 
  } 
  </code></pre>
  
  <p>I am trying to bind a dropDown list with the unique department name (Department.Name) using query expression syntax. I have a collection of Employee type. The following doesn't seems to work.</p>
  
  <pre><code>dropDown1.DataSource = employees.Select(e =&gt; e.Department ).ToList()
  </code></pre>