Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

map multiple entities to same table in ef core 2.0

$
0
0

HI, 

I would like to map multiple entities  to same table in EF core , can this be done? 

public class Person
{
public int PersonId { get; set; }
public string FirstName { get; set; }
public string MiddleName { get; set; }
public string LastName { get; set; }
public Address CurrentAddress { get; set; }
public Address PermanentAddress { get; set; }

}

public class PersonId
{
public int PersonId { get; set; }
public string FirstName { get; set; }
public string MiddleName { get; set; }

}

Instead of using seperate data context can we still use same db contexzt and map them to same table ?


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>