Sparky
Sparky
CC#
Created by Sparky on 1/24/2023 in #help
❔ Is there an easy way to serialize a Dictionary<string, string> to XML nodes?
Yeah, I think I solved it.
public class MyAttribute : IXmlSerializable {

public string Key { get; set; }
public string Value { get; set; }

public XmlSchema GetSchema() => null;

public void WriteXml(XmlWriter writer)
{
writer.WriteElementString(Key, null, Value);
}

public void ReadXml(XmlReader reader)
{
}
}
public class MyAttribute : IXmlSerializable {

public string Key { get; set; }
public string Value { get; set; }

public XmlSchema GetSchema() => null;

public void WriteXml(XmlWriter writer)
{
writer.WriteElementString(Key, null, Value);
}

public void ReadXml(XmlReader reader)
{
}
}
11 replies
CC#
Created by Sparky on 1/24/2023 in #help
❔ Is there an easy way to serialize a Dictionary<string, string> to XML nodes?
Oh yeah. I'm currently trying to write a IXmlSerializable to see if I can get it to work..
11 replies
CC#
Created by Sparky on 12/16/2022 in #help
❔ How do I resolve a 'package downgrade' if one of my dependencies needs an older version of a dll?
To put it simply: How can I have two different versions of the same nuget package installed in one solution?
5 replies
CC#
Created by Sparky on 10/20/2022 in #help
EF Core is throwing DbUpdateConcurrencyException, but only on the production database (MySQL)
I updated my deployment scripts to use the dotnet ef migrations script tool to generate an idempotent sql file to apply the migrations to prod, and it works now.
3 replies
CC#
Created by Sparky on 10/20/2022 in #help
EF Core is throwing DbUpdateConcurrencyException, but only on the production database (MySQL)
Update: I used DataGrip's built in import/export tools to clone my local dev database to prod. It turns out that this tool is doing something funny, and doesn't replicate the DDL on the target exactly as it should be.
3 replies
CC#
Created by Elio on 10/18/2022 in #help
Sqlite Entityframework
I would put all the directly user-related properties in the User model. If you'll have many options per user, or more complex data structures, you can serialize the UserOptions class as json/xml in the database. But if you do this, keep in mind that you won't be able to easily query user options directly (e.g. select all users with EN language).
2 replies
CC#
Created by Sparky on 8/24/2022 in #help
How can I sort a list of entries (Id, ParentId) into a tree hierarchy? [Answered]
Okay, this was the correct solution and it was easier than I was expecting. Thanks for everyone for the help!
8 replies
CC#
Created by Sparky on 8/24/2022 in #help
How can I sort a list of entries (Id, ParentId) into a tree hierarchy? [Answered]
I was hoping that there would be a simpler solution, but I will try it. Thanks!
8 replies