title: Linq query return true or false
body: <p>I have a query where it should return TRUE or FALSE. </p>
  
  <pre><code>var query = from c in db.Emp
              from d in db.EmpDetails 
              where c.ID == d.ID &amp;&amp; c.FirstName == "A" &amp;&amp; c.LastName == "D" 
            // It should return TRUE when this above statement matches all these conditions
  </code></pre>
  
  <p>and I want to attach this query result to a property(of string datatype)</p>
  
  <pre><code>this.result = Conert.ToBoolean(query);
  </code></pre>
  
  <p>how to achieve this in LINQ ? </p>
  
  <p>EDIT:</p>
  
  <p>EmpMapper class</p>
  
  <pre><code>  public class EmpMapper
    {
      EmpEntities db;
      // ID column already exists in the DB
      private int ID;
      // I am creating this property to add it from the UI side, depending on the certain conditions in the query. That is why I created a separate class to map the existing ID from the DB
      bool result;
      public EmpMapper(int ID, bool result)
      {
        this.db = new EmpEntites();
        this.ID = ID;
        var query = from c in db.Emp
              from d in db.EmpDetails 
              where c.ID == d.ID &amp;&amp; c.FirstName == "A" &amp;&amp; c.LastName == "D" 
            // It should return TRUE when this above statement matches all these conditions
        this.result = Convert.ToBoolean(query);
      }
     public int ID
     {
      get{return this.ID;}
      set{this.ID = value;}
     }
     public bool result
     {
      get{return this.result;}
      set{this.result = value;}
     }
     } 
  </code></pre>
  
  <p>MainViewModel class     </p>
  
  <pre><code>      List&lt;EmpMapper&gt; empMapCol = new List&lt;EmpMapper&gt;();
  
       private void Page_Loaded(object sender, RoutedEventArgs e)
      {
        var emp_query = from c in db.Emp
                        orderby c.ID
                        select a;
       List&lt;Emp&gt; empCol = emp_query.ToList();
       foreach(Emp item in empCol)
       {
         this.empMapCol.Add(new EmpMapper(item.ID, item.result)); 
       }
       datagrid1.ItemsSource = empMapCol;
       }
       }
  </code></pre>