title: Same code to create parameters in Revit 2015 + 2016
body: <p>So the <a href="http://thebuildingcoder.typepad.com/blog/2015/04/whats-new-in-the-revit-2016-api.html#4.08" rel="nofollow">ExternalDefinitionCreationOptions had a spelling error</a> in the Revit 2015 API that was corrected in the 2016 API.</p>
  
  <p>I try to make my app as compatible as possible with the current version + previous, but this time I'm not even able to compile it since I can only reference one of the two API DLL's, and the <code>ExternalDefinitionCreationOptions</code> plays a big role in the process.</p>
  
  <p>The code is the following:</p>
  
  <pre><code>private static Definition GetSimpleParameterDefinition(UIApplication uiApp, Document doc, DefinitionGroup defGroup, string name)
  {
      var definition = defGroup.Definitions.FirstOrDefault(d =&gt; d.Name == name);
      if (definition != null) return definition;
  
      var parameterType = ParameterType.Text;
  
      var defOptions = new ExternalDefinitionCreationOptions(name, parameterType);
      BuiltInCategory target = BuiltInCategory.OST_Furniture;
      var cat = doc.Settings.Categories.get_Item(target);
  
      var catSet = uiApp.Application.Create.NewCategorySet();
      catSet.Insert(cat);
  
      definition = defGroup.Definitions.Create(defOptions);
  
      return definition;
  }
  </code></pre>
  
  <p>I'm reading about DI and IoC, but all the samples have all the code under control, not referencing a third-party API and dealing with it. I've run out of ideas.</p>
  
  <p>Any thoughts on how to accomplish this? </p>