How to write a LINQ query resulting in a Dictionary? July 25, 2023 by Tarik You need to specify the values for the Dictionary var d2 = q.ToDictionary(p => p.NickName, p => p.Name);