title: EF6 database first map one to one relationship
body: <p>In my database I have one-to-one relationships enforced by making a unique constraint on the foreign key table. This is correctly identified by the Sql Server Management Studio as one-to-one relation:</p>
  
  <p><a href="https://i.stack.imgur.com/fGVEQ.png" rel="noreferrer"><img src="https://i.stack.imgur.com/fGVEQ.png" alt="enter image description here"></a></p>
  
  <p>My problem is that EF6 does not identifies this as a one-to-one relation and generates a Collection on the Person class:</p>
  
  <p><a href="https://i.stack.imgur.com/wP4jA.png" rel="noreferrer"><img src="https://i.stack.imgur.com/wP4jA.png" alt="enter image description here"></a></p>
  
  <p>I could easily modify the T4 templates to not generate the collection when there is a unique key on the table IF the itemCollection in the t4 templates would contain the unique key information. But they only contain the foreign key information. I guess this is because the edmgen tool does not extract these information from the db. </p>
  
  <p>Is there a way to force the tool to include all the constraints in the database  so I can use this information in the t4 templates?</p>