D
David Morris
I am trying to create a nested Dictionary and get an error that seems odd to
me. Here is my declaration:
private IDictionary<Guid, IDictionary<Guid, string>>
myNestedDictionary
= new Dictionary<Guid, Dictionary<Guid, string>>();
I get an error unless I nest a Dictionary and not an IDictionary:
Error 3 Cannot implicitly convert type
'System.Collections.Generic.Dictionary<System.Guid,System.Collections.Generic.Dictionary<System.Guid,string>>'
to
'System.Collections.Generic.IDictionary<System.Guid,System.Collections.Generic.IDictionary<System.Guid,string>>'.
An explicit conversion exists (are you missing a
cast?) C:\Projects\DemoProject\Presenter\View\IncidentViewState.cs 29 15 Presenter
So this works:
private IDictionary<Guid, Dictionary<Guid, string>>
myNestedDictionary
= new Dictionary<Guid, Dictionary<Guid, string>>();
I would rather deal with the interface but I am forced to the implentation.
Thanks,
David Morris
me. Here is my declaration:
private IDictionary<Guid, IDictionary<Guid, string>>
myNestedDictionary
= new Dictionary<Guid, Dictionary<Guid, string>>();
I get an error unless I nest a Dictionary and not an IDictionary:
Error 3 Cannot implicitly convert type
'System.Collections.Generic.Dictionary<System.Guid,System.Collections.Generic.Dictionary<System.Guid,string>>'
to
'System.Collections.Generic.IDictionary<System.Guid,System.Collections.Generic.IDictionary<System.Guid,string>>'.
An explicit conversion exists (are you missing a
cast?) C:\Projects\DemoProject\Presenter\View\IncidentViewState.cs 29 15 Presenter
So this works:
private IDictionary<Guid, Dictionary<Guid, string>>
myNestedDictionary
= new Dictionary<Guid, Dictionary<Guid, string>>();
I would rather deal with the interface but I am forced to the implentation.
Thanks,
David Morris