0

I have implemented the project of EntityFramework 6 into EntityFramework Core 3.1. Using Roslyn API, I have to do migrate the Mapping the entity to tables in Entity framework. I have no idea about this.

Sample.cs

protected override void OnModelCreating(DbModelBuilder modelBuilder)
{
   modelBuilder.Entity<Student>().Map(m =>
   {
      m.Properties(p => new { p.StudentId, p.StudentName});
      m.ToTable("StudentInfo");
      }).Map(m => {
             m.Properties(p => new 
                     { p.StudentId, p.Height, p.Weight, p.Photo, p.DateOfBirth});
            m.ToTable("StudentInfoDetail");
    });
  modelBuilder.Entity<Standard>().ToTable("StandardInfo");
}

Based on stack overflow links are suggested, there is no more supported in EF core. Ref: One Entity 2 Tables in EF Core 2.0

Kindly suggest on alternative solution on this and how to do in Roslyn API?  

Karthic G
  • 1,162
  • 1
  • 14
  • 31
  • Does this answer your question? [One Entity 2 Tables in EF Core 2.0](https://stackoverflow.com/questions/45780404/one-entity-2-tables-in-ef-core-2-0) – ErikEJ Jan 11 '21 at 13:32
  • The question has already been answered in your linked question – ErikEJ Jan 11 '21 at 13:33
  • Table Splitting is the right one for Map() in EF Core, this is you what suggested, then there is no direct replacement and do more complex migration is expected.Right? – Karthic G Jan 11 '21 at 13:40

0 Answers0