❔ XMLAttributeCollection -> Dictionary with LINQ?
It's a confusing class. It only allows turning it into a Queryable, but I have no experience with those and would rather not.
How could I turn it into a dictionary of string->string?
15 Replies
Turn that
IQueryable
.ToDictionary()
it even says that AsQueryable is for turning IEnumerables into Queryables
yet Attributes lacks any of the functions to turn it into anything else
Huh
Out of curiosity, why not deserialize that XML to a good and proper class, instead of parsing it like that?
the list of attributes is dynamic
Oof
its not really a big deal, i just dont understand why it wouldnt let me do this basic linq stuff
Ah, huh, apparently only the generic
IQueryable<T>
has extension method that lets you turn it into a dictionaryI'm kind of at a loss lol
And then I try to do this and it gives me
object
??But its clearly XmlAttribute
Guess it has to be a for loop then or somethin. Just really weird
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.