title: Best practices WebAPI and multiple databases
body: <p>I have a problem. I am creating a webAPI with ASP.NET MVC, I've got three different projects with three separate databases.</p>
  
  <p>I have a method to do an Insert in one table. That table exists in three databases.</p>
  
  <p>The client sends me the project in a String.</p>
  
  <p>My question is:</p>
  
  <p>1 - Should I divide the webAPI in three different URLS?
  2- I don't want to create a switch or if-elseif in the controller this way:</p>
  
  <pre><code>switch (project) {
  case project1:
       objectdatabase1
  case project2:
       objectdatabase2
  case project3
       objectdatabase3
   }
  </code></pre>
  
  <p>Because I think it breaks the OPEN CLOSED Solid principle.</p>
  
  <p>3- Also I would like to inject de database object into de controller with Unity doing dependency injection.</p>
  
  <p>Any ideas to do these in the best way possible?</p>
  
  <p>Thank you!</p>