title: Entity Framework Mapping Oddity - member names cannot be the same as their enclosing type
body: <p>I have created an Entity Model from a DB, and getting an error "member names cannot be the same as their enclosing type". Which means there is a Property the same name as the Class.</p>
  
  <p>So the error is here</p>
  
  <pre><code>    /// &lt;summary&gt;
      /// There are no comments for Employee in the schema.
      /// &lt;/summary&gt;
      [global::System.ComponentModel.BrowsableAttribute(false)]
      [global::System.Runtime.Serialization.DataMemberAttribute()]
      public global::System.Data.Objects.DataClasses.EntityReference&lt;Employee&gt; EmployeeReference
      {
          get
          {
              return ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.GetRelatedReference&lt;Employee&gt;("HumanResourceModel.FK_EmployeeReferenceMapping_Employee", "Employee");
          }
          set
          {
              if ((value != null))
              {
                  ((global::System.Data.Objects.DataClasses.IEntityWithRelationships)(this)).RelationshipManager.InitializeRelatedReference&lt;Employee&gt;("HumanResourceModel.FK_EmployeeReferenceMapping_Employee", "Employee", value);
              }
          }
      }
  </code></pre>
  
  <p>which is part of </p>
  
  <pre><code>   [global::System.Data.Objects.DataClasses.EdmEntityTypeAttribute(NamespaceName="HumanResourceModel", Name="EmployeeReference")]
  [global::System.Runtime.Serialization.DataContractAttribute(IsReference=true)]
  [global::System.Serializable()]
  public partial class EmployeeReference : global::System.Data.Objects.DataClasses.EntityObject
  {
  </code></pre>
  
  <p>I can "fix" this error by renaming the name of the Property (but this will cause loads of issues in the future) , but how is this fixed from the created code? I renamed the Foreign Key to Mapping but that didn't work.</p>
  
  <p>Any ideas?</p>
  
  <p>Cheers Sarkie.</p>