title: protobuf-net serialization without attributes
body: <p>I have an assembly with DataContracts and I need to generate .proto schema for it to be able to exchange the data with java system. The DataContracts code can be changed but I cannot add <code>[ProtoContract]</code> and <code>[ProtoMember]</code> attributes in it because it will result in protobuf-net assembly dependency. We use WCF in C# parts of the system so we would not want to have dependency on proto-buf assembly in most of C# projects that don't work with java system.</p>
  
  <p>On the protobuf-net site in a <a href="http://code.google.com/p/protobuf-net/wiki/GettingStarted#Don%27t_Like_Attributes?">GettingStarted</a> section it's said that:</p>
  
  <blockquote>
    <p>Don't Like Attributes?<br>
    In v2, everything that can be done with attributes can also be configured at runtime via RuntimeTypeModel.</p>
  </blockquote>
  
  <p>However I've no clue how to actually configure serialization without attributes and I haven't seen any examples of that.</p>
  
  <p>I'm trying to do</p>
  
  <pre><code>[DataContract]
  public class MyEntity
  {
      [DataMember(Order = 1)]
      public String PropertyA { get; set; }
  
      [DataMember(Order = 2)]
      public int PropertyB { get; set; }
  }
  
  RuntimeTypeModel.Default.Add(typeof(MyEntity), false);
  
  string proto = Serializer.GetProto&lt;MyEntity&gt;();
  </code></pre>
  
  <p>And get the following as the value of <code>proto</code></p>
  
  <pre><code>package ProtobufTest;
  
  message MyEntity {
  }
  </code></pre>