Saturday 15 February 2014

Generic result to key value list or dictionary in vb.net -



Generic result to key value list or dictionary in vb.net -

i need homecoming key value paired list of state (region) names abbreviated value within dnn install. in function below obtain desired results inferred variable named regionlist, cannot cast these results key value paired list or dictionary , homecoming result. help appreciated.

public function getregionpercountry(countrycode string) list(of keyvaluepair(of string, string)) dim lc new dotnetnuke.common.lists.listcontroller() dim countryid integer dim regionlist2 list(of keyvaluepair(of string, string)) = new list(of keyvaluepair(of string, string)) if not countrycode nil dim entrycollection system.collections.generic.list(of dotnetnuke.common.lists.listentryinfo) entrycollection = lc.getlistentryinfoitems("country") countryid = entrycollection.where(function(x) x.value = countrycode).select(function(x) x.entryid).firstordefault() entrycollection = lc.getlistentryinfoitems("region") dim regionlist = entrycollection.where(function(x) x.parentid = countryid).select(function(x) new {.key = x.text.tostring(), .value = x.value.tostring()}).tolist() regionlist2 = regionlist end if homecoming regionlist2 end function

vb.net dictionary collections key-value

No comments:

Post a Comment