I am trying to use elvis operator to achieve something like this
List<string> list = new List<string> { "str1", "str2", "str3"};
string searchkey = "str4"; // this does not exist in the list so will use elvis operator before picking the first from the resulting sequence.
var result = list.where(s=>(s.Contains(searchkey)))?.First();
I expect result to be null but the code actually throws an exception.