I have a table in database as follows…
ID(INT) Values(VARCHAR(50))
1 200,300
2 100
3 400,500
when I query, I need to get this data in a Dictionary>
The code I have so far is…
var x = (from o in Values
select o).ToDictionary(o=>o.ID, p=>p.Values)
I would like the p.Values to be converted to a List so I also need to perform a Convert.ToInt32() possibly!
Any ideas?
This should work:
.Select(x => Convert.ToInt32(x))can be converted to a method group like this 😉.Select(Convert.ToInt32)