简体   繁体   中英

Null reference exception using DbSet.Find()

See screenshot:

在此处输入图片说明

As you can see in the above picture, I'm getting a null reference exception when I attempt to call Db.Players.Find() , despite the fact that the value I'm giving it to find quite clearly exists in the table that I'm asking it to search.

I'm still just a bit of a newcomer to this, so I don't really have the foggiest idea what I could be doing wrong.

All I want is to be able look through the Players table, and add the player with the specified ID to Pairs.Players, which is simply a list of players itself.

Pair.Players可能为空。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM