title: Entity Framework CodeFirst with many-to-many relationship via DataAnnotations
body: <p>I am trying to create a many-to-many relationship between the following objects:</p>
  
  <pre><code>public class Classified{
      [Key]
      public int Id {get;set;}    
      public string details {get;set;}
      public ICollection&lt;ClassifiedRating&gt; Ratings {get;set;}  
  }
  
  public class User{
      [Key]
      public int Id {get;set;}
      public string Name {get;set;}
  }
  
  public class ClassifiedRating{
      [Key]
      public User Rater {get;set;}
      [Key]
      public Classified Classified {get;set;}
      public int rating {get;set;}
  }       
  </code></pre>
  
  <p>I receive the following errors when I run it:</p>
  
  <pre><code>One or more validation errors were detected during model generation:
  
  \tSystem.Data.Entity.Edm.EdmEntityType: : EntityType 'ClassifiedRating' 
  has no key defined. Define the key for this EntityType.
  
  \tSystem.Data.Entity.Edm.EdmEntitySet: EntityType: EntitySet 'ClassifiedRating'
   is based on type 'RateUser' that has no keys defined.
  </code></pre>
  
  <p>(the "\t"'s are appearing in the error message as well, though I doubt it is relevant, it's kinda weird....)</p>