I\'m doing the mvcmusicstore practice tutorial. I noticed something when creating the scaffold for the album manager (add delete edit).
I want to write code elegantl
Didnt work for me. But I solved it by doing like this.
var item = db.Items .Include(i => i.Category) .Include(i => i.Brand) .Where(x => x.ItemId == id) .First();
Dont know if thats a ok solution. But the other one Dennis gave gave me a bool error in .SingleOrDefault(x => x.ItemId = id);
.SingleOrDefault(x => x.ItemId = id);