EDN Admin
Well-known member
Hi All,
Trying to check what is the best way of extracting matching values from a DictionatyObject.
I am using below code to extract values for matching keys. - works perfectly fine, however it too time consuming. I have about 300,000+ records in my one dictionary object - below code works perfectly fine, but too time consuming to extract value
for matching key. Wondering is there any better way of doing this?
<pre class="prettyprint var value = DATReader.listvals.Keys.Where(key => key.Contains(tradeID.ToUpper())). ToList(); [/code]
My requirement is - I have 2 different Dict object say Dict1 and Dict2. Need to get matching prices from Dict2 , by passing Dict1->id, and saving it in Dict1->price.
Parsing using contains is taking around 30 minst to parst 5000 ids. Dict1 got 5000 ids and Dict2 is a master list which has 300,000 + key value combination. I have to use where contains as my Ids in dict2 contains only first part of id from dict1.
for e.g Dict1.id= ABC , Dict2.id=ABCXYZ, Dict2.price = 1.00 - so by searching dict2 with ABC, I need to extract 1.00.
Hope its clear.
View the full article
Trying to check what is the best way of extracting matching values from a DictionatyObject.
I am using below code to extract values for matching keys. - works perfectly fine, however it too time consuming. I have about 300,000+ records in my one dictionary object - below code works perfectly fine, but too time consuming to extract value
for matching key. Wondering is there any better way of doing this?
<pre class="prettyprint var value = DATReader.listvals.Keys.Where(key => key.Contains(tradeID.ToUpper())). ToList(); [/code]
My requirement is - I have 2 different Dict object say Dict1 and Dict2. Need to get matching prices from Dict2 , by passing Dict1->id, and saving it in Dict1->price.
Parsing using contains is taking around 30 minst to parst 5000 ids. Dict1 got 5000 ids and Dict2 is a master list which has 300,000 + key value combination. I have to use where contains as my Ids in dict2 contains only first part of id from dict1.
for e.g Dict1.id= ABC , Dict2.id=ABCXYZ, Dict2.price = 1.00 - so by searching dict2 with ABC, I need to extract 1.00.
Hope its clear.
View the full article