title: How do you update an object with Linq 2 SQL without rowversion or timestamp?
body: <p>I'm trying to take a POCO object and update it with Linq2SQL using an XML mapping file... This what what I have:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Text;
  
  namespace Business.Objects
  {
      public class AchievementType
      {
          public int Id { get; set; }
          public string Name { get; set; }
      }
  }
  
  
  &lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;Database Name="Name" xmlns="http://schemas.microsoft.com/linqtosql/mapping/2007"&gt;
    &lt;Table Name="dbo.AchievementTypes" Member="Business.Objects.AchievementType"&gt;
      &lt;Type Name="Business.Objects.AchievementType"&gt;
        &lt;Column Name="Id" Member="Id" IsDbGenerated="true" IsPrimaryKey="true" /&gt;
        &lt;Column Name="Name" Member="Name" /&gt;
      &lt;/Type&gt;
    &lt;/Table&gt;
  &lt;/Database&gt;
  
  CREATE TABLE AchievementTypes
  (
      Id          INTEGER         IDENTITY NOT NULL,
      Name        NVARCHAR(255)   NOT NULL,
  
      CONSTRAINT PK_AchievevementTypes 
          PRIMARY KEY (Id),
  
      CONSTRAINT UQ_AchievementTypes
          UNIQUE (Name)
  )
  </code></pre>
  
  <p>and i'm doing the following to update it:</p>
  
  <pre><code>var type_repo = new BaseRepository&lt;AchievementType&gt;();
  var t1 = new AchievementType { Name = "Foo" };
  type_repo.Insert(t1);
  t1.Name = "Baz";
  type_repo.Save(t1, "Id");
  </code></pre>
  
  <p>and my repository Save is just doing:</p>
  
  <pre><code>public void Update(TData entity)
  {
      using (var ctx = MyDataContext())
      {
          ctx.GetTable&lt;TData&gt;().Attach(entity);
          ctx.SubmitChanges();
      }
  }
  </code></pre>
  
  <p>The update doesn't fail or anything, but the data in the database has not changed.</p>