title: Entity Framework code first One to Many Relationship with same database table
body: <p>My Entities look like -</p>
  
  <pre><code>[Table("DoctorSchedule")]
      public class DoctorSchedule
      {
          [Key]
          public int Id {get; set;}
  
          [Column("DoctorId")]
          public virtual Doctor Doctor { get; set; }
          public virtual ICollection&lt;Schedule&gt; Schedules { get; set; }
      }
  
  public class Schedule
      {            
          public DayOfWeek Day { get; set; }
          public DateTime StartTime { get; set; }
          public DateTime EndTime { get; set; }
  
          [Required]
          public DoctorSchedule DoctorSchedule { get; set; }
      }
  </code></pre>
  
  <p>I would like to have entites as above but the SQL Table should be One. The Table should be "DoctorSchedule" with the columns are "Id","DoctorId","Day","StartTime","EndTime".</p>
  
  <p>Please suggest the code using Data Annotations or FluentAPI.</p>