I am sure I am just missing something basic so hope I can get my question across clearly.
I have a class named ItemData which implements an interface IITemData. Within the class ItemData I have the following:
However when I am trying to use this ItemData class (via the interface) it looks like this ComponentType is loading okay:
But when I am trying to access it in a lambda expression:
I keep getting the Object Reference error from the above.
I have the feeling I am just missing something straight forward.
Try it with null check maybe, seems like some of the data in list are null
var sortedList = new List<IItemData>(new ItemData[]{originalList.Where(x => x?.ComponentType?.Name == "template").SingleOrDefault()});