I have to aggregate 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);
What I want now, is ONE dictionary containing all elements of the agents & objects dictionary.
You may think that there could be a problem with duplicate keys, but each key (id) is unique, so there will be no problem.
Would be very cool, if this task could be done via only one LINQ query.