I using lambda expression with where condition to get a count against a addresscollection.
Some of the addresscollection objects have null values to it. For some reason i am getting object not set to an instance of an object. when i dig into the exception, i found return type as {Name = “Boolean” FullName = “System.Boolean”} and return parameter {Boolean}. ANy ideas on how to handle this exception.
Here is my lambda expression that i was using:
var codes = (addresscollection.Where(n => n.Code.Contains("A") || n.Code.Contains("S") || n.Code.Contains("Q"))).Count()
either the collection is null or one of the codes is null.