using System.Collections.Generic;
public static void Main()
Console.WriteLine("Hello World");
var blah = new Dictionary<string, string>()
{ "SomeKey", "SomeValue" }
Dictionary<string, string> anotherBlah = null;
var yetAnotherBlah = new Dictionary<string, string>();
if (blah?.Any() ?? false)
Console.WriteLine("blah?.Any() is true");
if (anotherBlah?.Any() ?? false)
Console.WriteLine("anotherBlah?.Any() is true");
if (yetAnotherBlah?.Any() ?? false)
Console.WriteLine("yetAnotherBlah?.Any() is true");
var caseSensitiveStuff = new Dictionary<string, string>()
{ "somekey", "SomeValue" },
if (caseSensitiveStuff?.Any(kvp => kvp.Key.Trim().Equals("SomeKey", StringComparison.OrdinalIgnoreCase)) ?? false)
Console.WriteLine("SomeKey was found!!");