title: How to increment a value using one command using entity framework
body: <p>How can i transform this sql query to an EF linq command</p>
  <pre><code>&quot;update dbo.table set col1= col1 + 1 where Id = 27&quot; 
  </code></pre>
  <p>i want to execute this query using one command to avoid concurrency problems
  in case of another client modify the record in the same time</p>
  <p>i'm looking for doing that using EF but in one command</p>
  <p>i tried this but i'm looking for a better solution :</p>
  <pre><code>context.table1.FromSqlInterpolated($&quot;update dbo.table  set col1= col1+ 1 where Id=27&quot;).FirstOrDefaultAsync();
  </code></pre>