title: Moving OData WebAPI controllers to separate assemblies
body: <p>I have an odata web api project that includes the app_start stuff and global.asax file and would like to put the controllers and models in separate assemblies and not reference them. I've got this working using MEF but am having problems registering them. Eg.</p>
  
  <pre><code>builder.EntitySet&lt;PersonModel&gt;("Persons");
  </code></pre>
  
  <p>The approach I've taken is work out what my types are from my loaded controllers ans store these as strings but I'm unable to convert these to types and invoke the ODataModelBuilder.EntitySet method by doing something like this:</p>
  
  <pre><code>                MethodInfo method = builder.GetType().GetMethod("EntitySet");
                  MethodInfo genericMethod = method.MakeGenericMethod(Type.GetType(type));
                  genericMethod.Invoke(builder, null);
  </code></pre>
  
  <p>The problem is that Type.GetType(type) returns null since the type is in a separate assembly.</p>
  
  <p>I've no idea whether my current approach will work if I do get over this stumbling block and would appreciate any suggestions of how to achieve splitting my controllers out.</p>