I just published a new version of my open source C# Dandraka.Slurper library in Github and Nuget.org.
The new version, 2.0, implements the existing XML functionality but, additionally, for Json. And because it’s not just about XML anymore, I had to rename it from Dandraka.XmlUtilities (which, if I’m being honest, sounded bad anyway) to Dandraka.Slurper. It also targets .Net Standard 2.1.
Here’s a quick usage example:
using Dandraka.Slurper;
public void PrintJsonContents1_Simple()
{
string json =
@"{
'id': 'bk101',
'isbn': '123456789',
'author': 'Gambardella, Matthew',
'title': 'XML Developer Guide'
}".Replace("'", "\"");
var book = JsonSlurper.ParseText(json);
// that's it, now we have everything
Console.WriteLine("id = " + book.id);
Console.WriteLine("isbn = " + book.isbn);
Console.WriteLine("author = " + book.author);
Console.WriteLine("title = " + book.title);
}
Separately, there are a couple of changes that don’t impact the users of the library:
- A Github Codespace configuration was added to the repository (in case I want to fix a bug on my iPad while traveling 😊).
- The test project was migrated from DotNet Core 3.1 to 6.0.
The new version is backwards compatible with all previous versions. So if you use it, updating your projects is effortless and strongly recommended.