Cannot update a timestamp column after .Attach
<p>I have this ASP.Net code and I was getting an error when running it. The error was: </p>

<blockquote>
  <p>Server: Msg 272, Level 16, State 1, Line 1 Cannot update a timestamp
  column.</p>
</blockquote>

<p>Here's the mapping for this table that I already have:</p>

<blockquote>
  <p>Property(x =>
  x.Version).HasColumnName(@"Version").IsOptional().HasColumnType("timestamp").HasDatabaseGeneratedOption(System.ComponentModel.DataAnnotations.Schema.DatabaseGeneratedOption.Computed);</p>
</blockquote>

<p>Note that I do have a version column in my table.</p>

<pre><code>    public async Task&lt;IHttpActionResult&gt; Put([FromBody]WordForm wordForm)
    {
        // SampleSentences -&gt; s

        var oldsObj = db.SampleSentences
                    .Where(w =&gt; w.WordFormId == wordForm.WordFormId)
                    .AsNoTracking()
                    .ToList();
        var newsObj = wordForm.SampleSentences.ToList();

        // There is other code here to modify SampleSentences
        //
        //

        // db.WordForms.Attach(wordForm);
        // db.Entry(wordForm).State = EntityState.Modified;
        wordForm.StatusId = (int)EStatus.Saved;
        await db.SaveChangesAsync(User, DateTime.UtcNow);
        return Ok(wordForm);
    }
</code></pre>

<p><strong>I was able to fix the error</strong> by adding comments to the two lines in the method. But could someone explain why I am getting the error if I don't comment out those lines. Should I not be able to Attach the wordForm and mark as Modified?</p>