title: Using "where": Cannot convert lambda expression to type 'bool'
body: <p>I have entity framework code as shown below.I am getting following error in where condition.</p>
  
  <blockquote>
    <p>Cannot convert lambda expression to type 'bool' because it is not a delegate type</p>
  </blockquote>
  
  <p>How to overcome this error? What is the reason for this error?</p>
  
  <pre><code>    static void Main(string[] args)
      {
  
          ClubCreation();
          List&lt;Club&gt; selectedClubs = GetClubs("club1");
  
      }
  
      public static void ClubCreation()
      {
  
          string connectionstring = "Data Source=.;Initial Catalog=NerdDinners;Integrated Security=True;Connect Timeout=30";
          using (var db = new NerdDinners(connectionstring))
          {
  
              Club club1 = new Club();
              club1.ClubName = "club1";
  
              Club club2 = new Club();
              club2.ClubName = "club2";
  
              Club club3 = new Club();
              club3.ClubName = "club3";
  
              db.Clubs.Add(club1);
              db.Clubs.Add(club2);
              db.Clubs.Add(club3);
  
              int recordsAffected = db.SaveChanges();
  
  
          }
      }
  
      public static List&lt;Club&gt; GetClubs(string clubName)
      {
          string connectionstring = "Data Source=.;Initial Catalog=NerdDinners;Integrated Security=True;Connect Timeout=30";
          using (var db = new NerdDinners(connectionstring))
          {
  
              Club club1 = new Club();
              Club club2 = new Club();
              Club club3 = new Club();
  
  
              var query = from o in db.Clubs
                          where (p =&gt; p.ClubName == "club1")
                          select o;
  
              return query.ToList();
  
  
  
  
  
          }
      }
  </code></pre>