title: Entityframework core how to map Many-to-Many without creating a join table
body: <p>I am trying this activity to clone from existing .edmx project to code first. </p>
  
  <p>I have two entities. I want to have many to many relation without creating a new table. I am using EF Core 2.0 code first approach. </p>
  
  <p>Please find below the entity i have created. I am not sure whether is this is the right way to do this.</p>
  
  <p>I would like to have the foreign key column on both the tables ie. WorkflowId and WorkCaseId on WorkCase and Workflow tables respectively.</p>
  
  <pre><code>    public class WorkCase
      {
          [Key]
          public int WorkCaseId { get; set; }
  
          public int WorkflowId { get; set; }
  
          public int CaseDetailId {get;set;}
  
          public CaseDetail CaseDetail {get;set;}
  
          public WorkFlow WorkFlow { get; set; }
  
          public ICollection&lt;WorkFlow&gt; WorkFlows { get; set; }
      }
  
      public class WorkFlow : BaseEntity
      {
          [Key]
          public int WorkFlowId { get; set; }
  
          public string Comment { get; set; }
  
          public DateTime? UpdateDate { get; set; }
  
          public int WorkCaseId { get; set; }
  
          public WorkCase WorkCase { get; set; }
  
          public ICollection&lt;WorkCase&gt; WorkCases { get; set; }
      }
  </code></pre>
  
  <p>My expectation is as below. Can anyone help how to achieve the EF Core configuration:
  - Workcase will have the latest workflowid
  - workflow will have history for each workcaseid.</p>
  
  <p><a href="https://i.stack.imgur.com/0FrlG.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/0FrlG.jpg" alt="enter image description here"></a></p>
  
  <p>Thanks</p>