Hi,
I have a dictionary(Dictionary<string, Guid>) which does not allow duplicates to be added. Is there a way that we can add duplicates into it?
Here is my code snippet which fails if there is a key already in the dictionary.
Dictionary<string, Guid> dictLookupLocation = new Dictionary<string, Guid>();
QueryExpression locationQuery = new QueryExpression("new_locations");
locationQuery.ColumnSet = new ColumnSet(true);
EntityCollection locationCollection = CRMHelper.GetCRMService().RetrieveMultiple(locationQuery);
foreach (Entity location in locationCollection.Entities)
{
string locationName = location.GetAttributeValue<string>("new_office");
if (!dictLookupLocation.ContainsKey(locationName))
{
dictLookupLocation .Add(locationName, location.Id);
}
}
Thanks for any help.
*This post is locked for comments
I have the same question (0)