I have two tables: Users and Tokens like below.
Now I write query using EF, it take Token object, but subobject User inside Token object is null. How should I modify my query to get Token with User object?
using (var db = new AccountDbContext())
{
Token tok = db.Tokens
.FirstOrDefault(p => tokenValue == p.Value) == 0);
if (tok.User == null)
{
//I'm there, but I 100% of sure thata this relation exists
throw new Exception();
}
}