I have this code
var contacts = dr.mktDoctorContacts
.GroupBy(x => x.ContactType)
.Select(zb => new
{
Key = zb.Key,
GroupWiseContacts = zb.Select(x => x.Contact).ToList()
})
.ToDictionary<string,List<string>>(y => y.Key, y => y.GroupWiseContacts)
I don't know what is wrong with this code.
Compile time error msg says:System.Generic.IEnumerable does not contain definition of and best extension method overloads has some invalid arguments. i can see only two overloads of ToDictionary Method in my visual studio tooltip sort of documentation whereas i have come across more than two overloads of ToDictionary on the web
Edit Here is exact Error message at compile time
Error 13 '
System.Collections.Generic.IEnumerable
' does not contain a definition for 'ToDictionary
' and the best extension method overload 'System.Linq.Enumerable.ToDictionary
' has some invalid arguments(System.Collections.Generic.IEnumerable , System.Func , System.Collections.Generic.IEqualityComparer )