Recently in learning to use dapper Baidu has a detailed use of the tutorial, in the Multi-table query, the following situation occurs.
The SQL used is as follows,
1 select * 2 from [ student ] As A 3 inner join [ junior ] as B on b.id= a.juniorid
Then I thought it was my own mistake, and found a lot of places not to find the reason. Then I found the big God. The article on dapper about the Spliton concept, which tells the description of how the dapper Gets the entity (as shown in the following figure), only to know that there might be a problem with the field order.
I then found the last column of ID, because the ID was not set when the table was created, and then the column was deleted and then reused the "ALTER TABLE table add column int IDENTITY (first) not NULL" new self-increment column.
The query condition is then given the following results to solve the problem.
1 SELECT 2 from[Student] as A3 InnerJOIN[Junior] as on b.id=A . Juniorid
This question is indeed relatively simple, appeared when looking for a long time, record down also give oneself a reminder.
Reference links in this article:
Https://ithelp.ithome.com.tw/articles/10198210?sc=rss.qu
Https://www.cnblogs.com/huangxincheng/p/5832281.html
Dapper a table field is empty when you query multiple tables