title: How to combine one to one entity with many to many
body: <p>Hallo I have a situation that I have a problem with:</p>
  
  <p>I Have 3 models lets say Device, Inbox and Suffix.
  Device can have only one Inbox and Inbox can be assign to many devices
  And Inbox and Suffix are connected with many to many relationship by junction table.</p>
  
  <p>fluent api for inbox(SectionName) and sugffix would look like:</p>
  
  <pre><code>            modelBuilder.Entity&lt;SectionName&gt;()
              .HasMany(suffix =&gt; suffix.SectionsSuffix)
              .WithMany(name =&gt; name.SectionsName)
              .Map(nameSuffix =&gt;
              {
                  nameSuffix.ToTable("SectionsNameSuffix");
                  nameSuffix.MapLeftKey("SectionNameId");
                  nameSuffix.MapRightKey("SectionSuffixId");
              });
  </code></pre>
  
  <p>Models are nothing special:</p>
  
  <p>Inbox:</p>
  
  <pre><code>[Table("SectionsName")]
  public class SectionName : BaseEntity
  {
      public SectionName()
      {
          SectionsSuffix = new List&lt;SectionSuffix&gt;();
      }
  
      [Required]
      public string Name { get; set; }
  
      public ICollection&lt;SectionSuffix&gt; SectionsSuffix { get; set; }
  }
  </code></pre>
  
  <p>Suffix:</p>
  
  <pre><code>[Table("SectionsSuffix")]
  public class SectionSuffix : BaseEntity
  {
      public SectionSuffix()
      {
          SectionLines = new List&lt;SectionLine&gt;();
          SectionsName = new List&lt;SectionName&gt;();
      }
  
      [Required]
      public string Name { get; set; }
  
      public ICollection&lt;SectionLine&gt; SectionLines { get; set; }
      public ICollection&lt;SectionName&gt; SectionsName { get; set; }
  }
  </code></pre>
  
  <p>And device:</p>
  
  <pre><code>public class Device
  {
      protected Device()
      {
      }
  
      public int Id { get; set; }
  
      public string Description { get; set; }
  
      public int? InboxId { get; set; }
  
      [ForeignKey("InboxId")]
      public virtual SectionName Inbox { get; set; }
  }
  </code></pre>
  
  <p>So basically one device can be connected to single combination of inbox and suffix</p>
  
  <p>Suffix is connected to another many to many but that's just for information.</p>
  
  <p>Now, I am looking for a way to when I get records from device entity will know witch combination is used. I was thinking about adding additional column to junction table, but would that complicate things, and I wonder if there is a another way to do it.</p>