I'm facing a weird problem, I haven't programmed much with c# and only started recently, so I apologise in advance if the question is in fact just a beginner mistake.
int i = 0;
var index = from x in (
from v in Category.Items
select new { Key = i++, Value = v })
where ((MenuCategory) x.Value).id == menuItems[items.SelectedIndex].category
select x.Key;
I'm trying to get the index of a specific object in Category.Items[]
(where the field id is a specific value, menuItems[items.SelectedIndex].category
)