List<DataRow> rowList;
var rowDict = rowList.ToDictionary(dr =>
double.Parse(dr.ItemArray[1].ToString()*5
- 10*double.Parse(dr.ItemArray[2].ToString), //Some calculation which
//sometime results in same key.
dr => dr
);
I want to ignore the key and data row insertion in the dictionary if the key is already inserted. Looking for doing it all in one iteration without calculating the key in advance and then carrying out the insertion. Looking to implement via Linq, have implemented using the Dict[key]
.