using System.Collections.Generic;
public static void Main()
var agents = new Dictionary<int, int>() { { 1, 2 }, { 2, 3 }, { 3, 2 } };
var pastRelatedAgents = agents.Where(x => x.Value == 4).Select(x => x.Key);
if (pastRelatedAgents == null)
Console.WriteLine("is null");
Console.WriteLine("is not null");