title: how to filter a sql condition in c#
body: <p>i have the following table is sql</p>
  
  <blockquote>
    <p><strong>Id | transaction</strong> </p>
    
    <p>15 |4785-t48er8-565</p>
    
    <p>24 |4587-dsfs-89554 </p>
    
    <p>784|sdf487-89d5-5sd</p>
  </blockquote>
  
  <p>in my program i pass in a <strong>transaction</strong>  in which i first need to check if the transaction <strong>exists</strong> in the database as follows</p>
  
  <pre><code>     var entry = (await _Repository.AsQueryableAsync()).FirstOrDefault(x =&gt; x.transaction == command.transaction);
       if (entry !=null)
      {
      // do something
      }
  </code></pre>
  
  <p>so the above works.
  My question is the transaction that exists how do i check if that transaction is equal to the <code>id</code> i pass in</p>
  
  <p>for example if i pass the following response from my api as</p>
  
  <pre><code>"transaction": "4785-t48er8-565",
  "id":569 
  </code></pre>
  
  <p>it will then check with the above code that the transaction exists. Now as you can see in the table the transaction <strong>4785-t48er8-565</strong> has an id of <strong>15</strong>
  but in my response i passed in <strong>569</strong></p>
  
  <p>how do i check if the transaction matches the id. I need to check first if it exists and then match it to the id</p>