title: Best practice to check few rows and columns with Linq and EF
body: <p>I have one table in MSSQL:</p>
  
  <pre><code>int Id
  int Col
  int Row
  </code></pre>
  
  <p>I have a tilemap with some objects on it. 
  Position of each object is <strong>top left tile</strong> (row and column number).
  Object can occupy few tiles.</p>
  
  <p>For example, i have an object with size <strong>3х3</strong>.
  Position of this tile is <strong>row 5</strong> and <strong>column 10</strong>.</p>
  
  <pre><code> IEnumerable&lt;int&gt; checkRows = Enumerable.Range(5, 3); // 5, 6, 7
   IEnumerable&lt;int&gt; checkCol = Enumerable.Range(10, 3); // 10, 11, 12
  </code></pre>
  
  <p>I need to check existing objects in this area before adding new one in DB:</p>
  
  <pre><code>5:10 | 5:11 | 5:12
  6:10 | 6:11 | 6:12
  7:10 | 7:11 | 7:12
  </code></pre>
  
  <p>If some object is in position 7:12, I will query DB too much before find it.</p>
  
  <p>For one tile I've used:</p>
  
  <pre><code> db.TileSet.Any(x =&gt; x.Col == col &amp; x.Row == row)
  </code></pre>
  
  <p>What is the best solution or practice to avoid high load of CPU with Linq in this case?</p>