title: .net 4.5 foreign key data annotation c#
body: <p>Is the <code>[foreign key("blah")]</code> not supported in .net 4.5 anymore ? When I import in the dataannotations model, intellisense tells me that it doesn't exist. The same happens with the inverse property. Are they trying to get us to use the fluent api for these types of opperations instead ? Are there any standards for fluent api vs data annotations ? </p>
  
  <p>Model :</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.ComponentModel.DataAnnotations;
  
  namespace DevCentral.Entities
  {   
      public partial class Category
      {    
          [Key]
          public int Id { get; set; }
  
          [MaxLength(75), MinLength(1)]
          public string Name { get; set; }
  
          [Required]
          public int ClassificationId { get; set; }
  
          [ForeignKey("ClassificationId"), InverseProperty("Categories")]
          public virtual Classification Classification { get; set; }
      }
  }
  </code></pre>