Legal Notice
The opinions expressed herein are my own personal opinions and do not represent my employer’s view in anyway.Top Posts
- C# HttpClient POST or PUT Json with content type application/json
- Creating dynamic arrays and lists using Dynamic and ExpandoObject in C#
- Using C# HttpClient from Sync and Async code
- Run tasks in parallel using .NET Core, C# and async coding
- C# Get expiry timestamp from JWT token
- c# Async fire and forget
- HttpClient retry mechanism with .NET Core, Polly and IHttpClientFactory
Archive
Meta
Tag Archives: XML
Manipulating XML Google Merchant Data using C# and LINQ
Receiving a Google Merchant Data feed (also known as a Google Product Feed) can be fairly easily manipulated on import time using a little C# and LINQ. The feed is basically a XML RSS 2.0 feed with some added properties … Continue reading
Posted in .net, .NET Core, c#, General .NET
Tagged c#, Google Merchant Data, Google Product Feed, LINQ, RSS 2.0, XML
Leave a comment
Remove duplicates from XML feed
Apparently XML isn’t dead yet, and today I received a Google Product Feed in the RSS 2.0 XML format. The feed was full of duplicates and my job is to remove them: As you can see, “Product 100” appears twice. … Continue reading
Posted in .net, .NET Core, c#, General .NET
Tagged Google Product Feed, LINQ, RSS 2.0, XDocument, XML
Leave a comment
Deserialize XML array to string[] and how to allow JSON to be deserialized into the same POCO class
How do you deserialize the classic XML array to an string[] type? The XML representation of an array is a list of elements: And the MyArray would normally be deserialized to an annoying class: The solution is to use the … Continue reading
XElement get default values using extension methods
I often work with dynamic XML documents which might or might not contain the element, field or attribute that I am looking for. The Standard .NET XElement class is pretty strict (as it should be) and returns a null reference … Continue reading
Posted in .net, c#, General .NET
Tagged Default values, Extension Methods, XElement, XML, XmlElement
1 Comment