title: Is there a straightforward way to determine the cardinality of a foreign key relationship using SMO?
body: <p>Using <code>SMO</code>, I'm trying to determine the <strong>cardinality</strong> of <code>ForeignKey</code> relationships between tables in a SQL Server database.  I could peruse each <code>ForeignKeyColumn</code> and look at each <code>Column</code> in the parent (and possibly also referenced) <code>Table</code>s, and look at the nullability of those columns as well as cross referencing with related <code>Index</code>es to determine <strong>cardinality</strong> (multiplicity on each end such as <code>0..1</code>, <code>1</code>, <code>*</code>) as illustrated by the following entity-relationship diagram:</p>
  
  <p><img src="https://i.stack.imgur.com/WxqPn.jpg" alt="enter image description here"></p>
  
  <p>But, there should be a more straightforward way to do this.  I don't see any relevant information in the <code>ForeignKey</code> <code>Properties</code> or <code>ExtendedProperties</code>.  The only item I could find in the MSDN Library was an <a href="http://msdn.microsoft.com/en-us/library/ee226196.aspx" rel="nofollow noreferrer">SfcCardinality</a> enumeration, which states "<em>Do not reference this member directly in your code. It supports the SQL Server infrastructure.</em>".</p>
  
  <p>Is there a straight forward way to get <strong>cardinality</strong> information via SMO?</p>