I need to fill out two dictionaries.
code:
private Dictionary <int, aor.PhysicalObject> agents; private Dictionary <int, aor.PhysicalObject> objects; agents = (from a in log .InitialState .Agents .Agent select a) .ToDictionary(d => Convert.ToInt32(d.id) , d => d as aor.PhysicalObject); objects = (from o in log .InitialState .Objects .Object select o) .ToDictionary(d => Convert.ToInt32(d.id) , d => d as aor.PhysicalObject);
Now I want this dictionary containing all the elements of the dictionary of agents and objects.
You might think that there might be a problem with duplicate keys, but each key (id) is unique, so there will be no problems.
It would be great if this task could be accomplished with just one LINQ query.
user1512559
source share