C#:将字典与列表相交。 Return 匹配后的字典项

C#: Intersect a dictionary with a list. Return dictionary item after match

如何确保 return 与列表中的项目匹配的字典项目?

static void Test()
{
    var dict = new Dictionary<string, string>();
    dict.Add("license1", "123");
    dict.Add("license2", "456");
    dict.Add("license3", "789");

    var list = new List<string>();
    list.Add("444");
    list.Add("111");
    list.Add("123");

    var result = dict.Values.Intersect(list);
    //result should be only the matching item as a dictionary for dict -> for this example = "license1, 123"
}

因为字典整理得不好我想我可以这样做:

var h = list.ToHashSet();
var result = dict.Where(kvp => h.Contains(kvp.Value));