Why is there an error
Error 52 Argument 1: cannot convert from \'System.Collections.Generic.Dictionary>\' to \'System.Collections.Generic.IDictionary>\'
Dictionary> implements IDictionary>, while you're trying to cast it to IDictionary>. It is not allowed, because IDictionary> has e.g. the method Add accepting instance of IList, while Add method in your Dictionary> won't accept IList as its input.