How map single entity with multiple table

前端 未结 3 895
囚心锁ツ
囚心锁ツ 2021-01-21 02:20

I want to get data from two tables with single Entity class. How??

public class HomeViewModel  
{ 
    [Key] 
    [Column(\"candidate_ID\")] 
    public int cand         


        
3条回答
  •  心在旅途
    2021-01-21 03:03

    Check data in daatbase table first.
    It is because you might not have related data in table2. i.e table1 primary key value (which is candidate_id) is not present in table2 foreign key candidateID...

提交回复
热议问题