title: asp.net razor query if else condition
body: <p>I have a query which brings picture from database  based on id which looks like this</p>
  
  <pre><code>var selectphotos = "Select * from ItemPhotos where ItemID= @0";
  </code></pre>
  
  <p>I want to hide image div if that query has 0 results or no pictures. 
  I tried </p>
  
  <pre><code>if(selectphotos.Count()  &gt; 0 ){
  &lt;div&gt; with pics &lt;/div&gt;
  }else{
  &lt;p&gt;just msg &lt;/p&gt;
  }
  </code></pre>
  
  <p>It didn't work pls help</p>