I have a linq statement that returns a list of <string,string> key value pairs. The problem is that all the values in the key need to be replaced. Is there a way to do a replace in the select of the linq without having to iterate through the entire list?
var pagesWithControl = from page in sitefinityPageDictionary
from control in cmsManager.GetPage(page.Value).Controls
where control.TypeName == controlType
select page; // replace "~" with "localhost"
You can’t change the key, but you can return a new object with the new key:
or if it has to be a KeyValuePair: