title: Good microservice pattern for "object based" sql database
body: <p>We have a legacy application based on SQL server and win32 middle-tier. Now, I’m searching for good solutions to write a microservice based REST based API to provide access to the data. We like to use VS, C# or JS and azure.
  A specialty of this application is, the Database has an uncommon "object based" approach. Each entity, say persons, files, groups, articles have a relation to a common “object” table. In this table common attributes are stored. There are also common 1-n related tables like categories. Each “object” has a unique guid.</p>
  
  <pre><code>person      --&gt;
  file        --&gt;   object   ---&gt; objectcategories
  article     --&gt;            
  </code></pre>
  
  <p>The new api should provide methods like:</p>
  
  <pre><code>GET /person/1 -&gt;
  {
      lastname: "Doe", prename: "John", sex: "m",
      guid: "{guid}", owner: "123",  // object specific attributes
  }
  
  GET /file/1 -&gt; 
  {
      filename:"test.docx", size:"123",
      guid: "{guid}", owner: "123",  // object specific attributes
  }
  
  GET /object/{guid-a} --&gt;
  {
      // Returns either file or Person data
  }
  </code></pre>
  
  <p>It should also allow to load additional data like</p>
  
  <pre><code>GET /person/1?categories -&gt;
  {
      lastname: "Doe", prename: "John", sex: "m",
      guid: "{guid}", owner: "123",  // object specific Attributes
      categories: [
           "green", "blue"
      }
  }
  </code></pre>
  
  <p>In reverse, it would be cool to simply safe an object back. The server must separate the data to the corresponding tables.</p>
  
  <pre><code>PUT /object/{guid} &lt;--
   {
      lastname: "Doe", prename: "John", sex: "m",
      guid: "{guid}", owner: "123",  // object specific Attributes
      categories: [
           "green", "blue"
      }
  }
  </code></pre>
  
  <p>What is a good pattern? Could Entity Framework (Database-first) do this? Would you go for a manual linq-sql based solution? Are there other suitable libraries for this task?</p>