title: Composite Key with EF 4.1 Code First
body: <p>I am trying to figure out how to have a composite key using EF code First 4.1 RC.</p>
  
  <p>Currently, I am using the [Key] Data Annotation, but I am unable to specify more than one key.</p>
  
  <p>how would one specify a composite key?</p>
  
  <p>Here is my Example:</p>
  
  <pre><code> public class ActivityType
  {
      [Key]
      public int ActivityID { get; set; }
  
      [Required(ErrorMessage = "A ActivityName is required")]
      [StringLength(50, ErrorMessage = "Activity Name must not exceed 50 characters")]
      public string ActivityName { get; set; }
  
  }
  </code></pre>
  
  <p>I need the "ActivityName" to also be a key.
  Sure, I can code around this, but thats not good database design.</p>