title: Unable to determine the relationship represented by navigation property ASP.NET core 2.0 Entity Framework
body: <p>I am currently developing an ASP.NET app that uses EntityFramework, for the given code</p>
  
  <pre><code>public partial class EnumMeta : Meta
  {
      public EnumMeta()
      {
          this.Messages = new HashSet&lt;MessageMeta&gt;();
      }
  
      public bool IsFlag { get; set; }
  
      public virtual ICollection&lt;MessageMeta&gt; Messages { get; set; }
  }
  
  public partial class MessageMeta : Meta
  {
      public MessageMeta()
      {
          this.Enums = new HashSet&lt;EnumMeta&gt;();
          this.Receiver = new HashSet&lt;Module&gt;();
          this.Sender = new HashSet&lt;Module&gt;();
      }
  
      public int MsgId { get; set; }
  
      public virtual ICollection&lt;EnumMeta&gt; Enums { get; set; }
      public virtual ICollection&lt;Module&gt; Receiver { get; set; }
      public virtual ICollection&lt;Module&gt; Sender { get; set; }
  }
  </code></pre>
  
  <p>I am getting an error:</p>
  
  <blockquote>
    <p>Unable to determine the relationship represented by navigation property 'EnumMeta.Messages' of type 'ICollection'. Either manually configure the relationship, or ignore this property using the '[NotMapped]' attribute or by using 'EntityTypeBuilder.Ignore' in 'OnModelCreating'.</p>
  </blockquote>
  
  <p>This code was auto-generated by EntityFramework using a WPF project and then the models were taken to an ASP.NET core 2.0 project to do a "code-first" approach to the database.</p>
  
  <p>I have already tried setting up <code>[ForeignKey("MessageMeta")]</code> above <code>public virtual ICollection&lt;MessageMeta&gt; Messages { get; set; }</code> without any positive solution.</p>