title: How do I get the "NameOf" on a Foreign Key?
body: <p>I am running into difficulties when trying to extract the attributes of a property contained in a foreign key attribute. To illustrate, I have these properties in some class</p>
  
  <pre><code>[Required(ErrorMessage = "Please enter value.")]
  public long ObjectCatalogId{ get; set; }
  
  [ForeignKey(nameof(ObjectCatalogId))]
  public ObjectCatalog ObjectCatalog { get; set; }
  </code></pre>
  
  <p>I want to find a way to get attributes on ObjectCatalogId property by looking at attributes on ObjectCatalog property. I expect this would mean extracting the name of the Foreign Key (which is ObjectCatalogId), then finding that property in the class ObjectCatalogId and ObjectCatalog  both live in and using reflection to get the attributes.</p>
  
  <p>My question is how do I get the name on the Foreign Key?</p>
  
  <pre><code> attribute.GetType().Name
  </code></pre>
  
  <p>Doesn't work. Additionally, are there more efficient ways of accomplishing this?</p>