title: How can I change StoreGeneratedPattern and force Entity Framework to generate insert statement with identity
body: <p>I have server and client database where I need to keep some of the server data in sync with client dataabse. Database schema is same apart from having IDENTITY(1,1) on server.</p>
  
  <p>Data can be created on server only. It has to be inserted on client with using server's id.</p>
  
  <pre><code>CREATE TABLE [MyServer].[dbo].[Test1](
  [Test1Id] [int] IDENTITY(1,1) NOT NULL,
  [Test1Value] [datetime] NOT NULL,
  CONSTRAINT [PK_Test1] PRIMARY KEY CLUSTERED ( [Test1Id] ASC ) ) ON [PRIMARY]
  
  CREATE TABLE [MyClient].[dbo].[Test1](
  [Test1Id] [int] NOT NULL,
  [Test1Value] [datetime] NOT NULL,
  CONSTRAINT [PK_Test1] PRIMARY KEY CLUSTERED ( [Test1Id] ASC ) ) ON [PRIMARY]
  </code></pre>
  
  <p>Is there any way to change StoreGeneratedPattern for entity classes without rebuilding assembly so I can insert IDENTITY on client side? I spent some time looking into </p>
  
  <pre><code>EntityModelCodeGenerator
  </code></pre>
  
  <p>but without any success.</p>
  
  <p>Of course I run server and client in different app domain so I can do this change on startup.</p>
  
  <p>I am using default EntityFramework classes. I can change to POCO entities if it resolves my problem. Classes are simple and referenced by id's instead of NavigationProperties.</p>
  
  <p>Thanks</p>