I'm scratching my head a bit here.
I have a custom object which I'm trying to search for a property that starts with some text.
If I search for a property using ==
instead of StartsWith
it doesn't error.
This works
Server serverObject = ServerObjectList.Find(n => n.Name == "Server001");
This gives a null ref exception
Server serverObject = ServerObjectList.Find(n => n.Name.StartsWith("Server001"));
Oddly, it works if the first object is the one your looking for.