I am in .net 2.0 .
I am looking for a smart fast way to merge two hash tables. For now i am doing it like
foreach (string id in _unValidatedMachine)
{
_Machine.Add(id, _unValidatedMachine[id]);
}
_unValidatedMachine.Clear();
I even not check here the inserted hash for existing of the key , probably i should do it .
Any ideas how to do the merge ?
There is not a standard way to join two Hashtables.
Yes, you should check if the key is already added, in other case you could get an exception.
Also you could use:
In this case, if the key exists, you will only overwrite its value.