❔ 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?
A
Angius•398d ago
Turn that
IQueryable
.ToDictionary()
I
ivi•398d ago
I
ivi•398d ago
it even says that AsQueryable is for turning IEnumerables into Queryables
yet Attributes lacks any of the functions to turn it into anything else
A
Angius•398d ago
Huh
I
ivi•398d ago
A
Angius•398d ago
Out of curiosity, why not deserialize that XML to a good and proper class, instead of parsing it like that?
I
ivi•398d ago
the list of attributes is dynamic
A
Angius•398d ago
Oof
I
ivi•398d ago
its not really a big deal, i just dont understand why it wouldnt let me do this basic linq stuff
A
Angius•398d ago
Ah, huh, apparently only the generic
IQueryable<T>
has extension method that lets you turn it into a dictionaryI
ivi•398d ago
I'm kind of at a loss lol
I
ivi•398d ago
And then I try to do this and it gives me
object
??I
ivi•398d ago
But its clearly XmlAttribute
I
ivi•398d ago
Guess it has to be a for loop then or somethin. Just really weird
A
Accord•397d ago
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.We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
51KMembers
View on DiscordWant results from more Discord servers?
More Posts❔ MS SQL Reporting Server URL Being RedirectedWe have an application from a vendor that was written in C# and we recently upgraded the MS SQL data❔ dataset memory leakI found memory leak and I don't understand how to fix it
Test case:
```cpp
public class MemoryLeaksT❔ WebAPI .NET 7.0 - Encrypt connectionstring in appsettings.jsonguys, I'm writing some WebAPI using .NET 7.0, and I'd like to secure the connectionstring with encry❔ how to read strings correctly with System.Data.SQLitei m trying read turkish characters from database but i can't see correctly❔ Blazor server app, base url / base page to set environmentHi 🙂
I have a Blazor Server app, where I would like to use some dynamic baseurl.
Say instead of my❔ C# Console Application -its only writing the same random string, how can i make it do different ones?❔ Rapid prototypingDo you feel there is such a thing as rapid prototyping or mvp development where you do things differ❔ HotChocolate with IQueryable, apply a required filter on the ef entityBasically, I'm trying to find a way to configure an `IObjectFieldDescriptor` by adding a required ar❔ Dev/prod databseHello,
Me and a friend wants to create a webb-app project with a react frontend and C# backend.
❔ Book recommendation to learn c#/dotnetI've been programming in python for a little under two years. I am starting a new job in c#.
Whats a❔ Use `this` inside method decoratorTried to follow https://stackoverflow.com/a/2966758
```cs
[AttributeUsage(AttributeTargets.Metho✅ How can I make VSCode auto add semicolons to statements on save?I'm coming from the world of Javascript and Typescript. There, you can just use Prettier to automati❔ Find common substring at start of every string in listI have a list of Windows path strings and I want to determine the common beginning shared by all of ❔ Code is completely skipping over an areaI'm writing a script for a game where if you don't press Spacebar within 4 seconds, the number of fa❔ Registering an extracted appx package```csharp
public static void RegisterMinecraftAppxPackage(string appxPackagePath) {
try {
✅ Exception Handling for NRE without modifying every call.I have a ReadData function which reads the memory of a process. If the process exits or crashes duri✅ please help idk what to do or what i didSeverity Code Description Project File Line Suppression State
Error Project❔ Better user experience inputting commandsHow would I get input from a user, the fancy way?
What I mean is that for example when a user types ❔ Return in the middle of a methodIs it ok?
I think that it improves readability and performance, but a professor I know argues that i❔ Can't build a MSIX Package for a WPF app