KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
Getting an InvalidCastException when trying something like this : IEnumerable<object> test = (IEnumerable<object>)new List<KeyValuePair<string, int>>(); However, this did work: IEnumerable<object> test = (IEnumerable<object>)new List<Dictionary<string, int>>(); So what's the big difference? Why can a KeyValuePair not be converted to an object? Update : I should probably point out that this did work: object test = (object)KeyValuePair<string,string>;
Tags (comma-separated)
Save Edits
Cancel