ItemsByGuid definition:
private Dictionary<string, Channel> ItemsByGuid = new Dictionary<string, Channel>();
i have a class:
public class Channel
{
[XmlAttribute]
[DataMember]
public string Title { get; set; }
}
and i try to add the class to a dictionary:
Channel _Channel = Utils.LoadXML<Channel>(file)
ItemsByGuid.Add(_Channel.Guid, _Channel);
im getting the error “The best overloaded method match for ‘System.Collections.Generic.Dictionary.Add(string, MyCMSDreams.Content.Channels.Channel)’ has some invalid arguments
”
any idea why?
Based on the fact that you’re passing a
GuidandChannelobjects into yourAdd()method, your ItemsByGuid defition should look something like this:Does it?