I'm trying to query some records from my database and convert the result into a Dictionary with string key and string value but continually gets the error "An item with the same key has already been added.".
this is my linq query:
var random = (from rec in db.tbl_generatedsampledetails
where rec.genID == id
select new
{
rec.@operator,
rec.internalID
}).ToDictionary(r => r.@operator, r => r.internalID);
Thanks for the help! :)