score:-1

I suspect your relationship is not 1 to 1.

score:0

Since you did an .Include("Users") you should be able to just traverse the User property in the Message object to get the information your want.

score:2

You forgot to include the declaration of your "Message" class but I suspect that the UserID property in that class is not declared as a nullable type. If that is the case, change it from "int" to "int?" (nullable int).


Related Articles