title: How to add a property to a document type in Umbraco from code?
body: <p>Could anyone give me an example of how to programatically add a property to an existing document type in Umbraco CMS? This is what I tried:</p>
  
  <pre><code>var dt = DocumentType.GetByAlias("TestDocType");
  dt.AddPropertyType(new DataTypeDefinition(-49),"testprop", "test prop");
  </code></pre>
  
  <p>But it throws an exception:</p>
  
  <pre><code>Method not found: 'Void umbraco.cms.businesslogic.ContentType.AddPropertyType(umbraco.cms.businesslogic.datatype.DataTypeDefinition, System.String, System.String)'.
  </code></pre>
  
  <p>Any ideas?</p>