Lambda expression error

I just ran into a problem while trying to find the index of an item in a List of structs of the type levelSeed. Here is the code…

int seedIndex = LevelObjects.IndexOf( item => item.unique == 1234 );

Sadly, this line of code, generates the following compiler error

error CS1660: Cannot convert 'lambda expression' to non-delegate type 'levelSeed'

Does anyone know what I’m doing wrong or what I may be missing? Do I have to include anything in the source to make Lambda expressions work?

Ok, IndexOf doesn’t take a delegate it takes just the item. If you want the index find yourself call FindIndex instead

var index = list.FindIndex(item => item.id == 123);

Thank you so much. That did the trick.