title: How to return IList<T> in Lambda query for this program
body: <p>I have Employee class, which has 3 properties, ID, Name, HireDate.</p>
  
  <pre><code>var employees = new List&lt;Employee&gt;()
  {
      new Employee {Employeeid = 1, EmployeeName = "Ravi", HireDate = new DateTime(2007, 2, 23)},
      new Employee {Employeeid = 2, EmployeeName = "Scott", HireDate = new DateTime(2007, 2, 23)},
      new Employee {Employeeid = 3, EmployeeName = "Megan", HireDate = new DateTime(2003, 9, 2)},
      new Employee {Employeeid = 4, EmployeeName = "Raj", HireDate = new DateTime(2010, 9, 23)},
      new Employee {Employeeid = 5, EmployeeName = "Major", HireDate = new DateTime(2003, 9, 23)},
      new Employee {Employeeid = 6, EmployeeName = "Kernel", HireDate = new DateTime(2011, 12, 3)},
  };
  </code></pre>
  
  <p>Now I need to write a function which returns an IList for particular ID. Based on Id I need all details of particular employee info.  I don't know where I'm missing it, its showing some error regarding return type. "Cannot convert bool to IList". Please help me.</p>
  
  <pre><code> private IList&lt;Employee&gt; GetDetails(List&lt;Employee&gt; list, int id)
  {
      return list.Select(e =&gt; e.Employeeid == id)
  }
  </code></pre>
  
  <p>which i'll use this function for Action delegate to write on console. </p>
  
  <pre><code>var query= GetDetails(list, 4); 
  </code></pre>
  
  <p>for this query i need to invoke print delegate. </p>
  
  <pre><code>Action&lt;Employee&gt; print = e =&gt; Console.WriteLine(string.Format("{0} Hired on  {1}",e.EmployeeName,e.HireDate));
  </code></pre>