title: Protobuf and Entity Framework DataBase Model
body: <p>I have the EF databaseModel.
  I serialize my class thet contains field with EF DB Table Type.
  I try to deserealize and i have the field with null fields.</p>
  
  <pre><code>class Myclass
  {
      public EFTable table {get;set;}
  }
  </code></pre>
  
  <p>EFTable</p>
  
  <ul>
  <li>string str;</li>
  <li>int num;</li>
  </ul>
  
  <p>[global::System.Data.Objects.DataClasses.EdmScalarPropertyAttribute(EntityKeyProperty=true, IsNullable=false)]
  [global::System.Runtime.Serialization.DataMemberAttribute()]      [global::System.CodeDom.Compiler.GeneratedCode("System.Data.Entity.Design.EntityClassGenerator", "4.0.0.0")]</p>
  
  <p>After deserialization
  EFTable
  - string str=null
  - int num=0</p>
  
  <p>why? how fix it without creating temp classes?</p>
  
  <pre><code>public static byte[] Serialize(BaseInspection inspection)
  {
      using (var file = File.Create(path.ToString()))
      {
          Serializer.Serialize(file, inspection);
      }
      return File.ReadAllBytes(path.ToString());
  }
  
  static BaseInspection Desirialize(byte[] path)
  {
  
      using (Stream stream = new MemoryStream(path))
          return Serializer.Deserialize&lt;BaseInspection&gt;(stream);           
  }
  </code></pre>