Before this is marked as a duplicate, I have checked the other related posts and they do not answer my question.
I am working on a legacy database that has 2 tables
You can use Entity Splitting to achieve this if you have the same primary key in both tables.
modelBuilder.Entity<TestResult>()
.Map(m =>
{
m.Properties(t => new { t.Name, t.Text, t.Units /*other props*/ });
m.ToTable("Result");
})
.Map(m =>
{
m.Properties(t => new { t.Status, t.Analysis /*other props*/});
m.ToTable("Test");
});
Here's a useful article