I have some code which is failing - actually I cannot edit it. Following here and I'm trying to figure out the operation of this code, i.e. what this is doing. Its failing, but I do not know where exactly.
Dictionary<long, IList<Cell>> ByBlock =
mCache.ListBlocks.SelectMany(e => e.Value).Where(e => listBlocks.Contains(e.Key)).Select(
Block => new KeyValuePair<long, IList<CellToSubCatchment>>(Block.Key,
DataMgr.GetMapping(
"CASH",
Block,
GetKey(IdKeys, Block),
mType))).ToDictionary(e => e.Key, e => e.Value);
I'm getting the error: Value cannot be null, but I do not know what value is null and since I cannot edit the code or run Lambda's in the immediate window, I'm having trouble debugging this. So any ideas on how it works or the better way to look at these lambdas?
Valuewould benull, such that the conversion to a dictionary fails; perhaps theSelectManyfails.