I have an EF query in which I am returning an 'Item' by it's unique identifier. I'm using the scaffolded controller provided by MVC and this works ok, but now I want it to return a list of tags which belong to the item.
I thought I might be able to use 'Include' as shown below to eager fetch the tags. However this does not seem to be allowed when using async.
Item item = await db.Items.Include("Tags").FindAsync(id);
Can anybody explain why this won't work and suggest an alternative way to bring back the item's tags?
Cheers
Ben
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…