title: Generating Interfaces from entity framework database first auto-generated code
body: <p>I am using MVC3, C# 4.0 and Entity Framework in Visual Studio 2010. I am generating my edmx and Designed.cs files from a database. I am then generating interfaces from the entities in the Designer.cs file as part of my nLayer structure.</p>
  
  <p>The original code is</p>
  
  <pre><code>public partial class DataEntrySummary : EntityObject
  </code></pre>
  
  <p>which then becomes</p>
  
  <pre><code>public partial class DataEntrySummary : EntityObject, Mb.Interface.IDataEntrySummary
  </code></pre>
  
  <p>My concern is that when the database changes (and it will) and I regenerate the edmx files I will lose all the interface definitions.</p>
  
  <p>Is there a better way of achieving the same result without having to regenerate the interfaces.</p>
  
  <p>Thank you</p>