Why is deserializing this JSON resulting in `null`?

Advertisements I have the following JSON: { "countries": [ { "name": "Afghanistan", "alternative_names": [], "formal_name": "Islamic Republic of Afghanistan", "the_prefix": false, "in_un": true } ] } The following classes: [Serializable] public class CountriesData { public List<CountryData> countries; } [Serializable] public class CountryData { /// <summary> /// The informal name of the country. /// <example> ///… Read More Why is deserializing this JSON resulting in `null`?

Extract values from JSON text field for use in "IN" statement SQL

Advertisements In Azure SQL server. I have the following (non-functional) query that is attempting to use the values from a JSON array of foreign keys to find rows, using "IN". SELECT * FROM foo_table WHERE foo_table_id IN (SELECT json_ids_field FROM bar_table WHERE bar_table_id _field= 1); However this returns an error because it does not natively… Read More Extract values from JSON text field for use in "IN" statement SQL

Deserializing XML from String C#

Advertisements I am receiving XML strings,and would like to convert these to C# objects. Just to confirm, Is it correct? This is my class : [XmlRoot("xml")] public class GenCrfeidData { [XmlAttribute("ccris_identity")] public GenCrfeidCCRIS_Identity ccris_identity { get; set; } [XmlAttribute("spga_identity")] public GenCrfeIDSPGA_Identity spga_identity { get; set; } } public class GenCrfeidCCRIS_Identity { [XmlAttribute("item")] public List<GenCrfeIDItem> item… Read More Deserializing XML from String C#

Trouble deserializing a json array using newtonsoft – array returned but all elements = nothing

Advertisements I am working with VS2019 in VB.net .Net Framework 4.7.2 and using Newtonsoft JSON tool. I have this JSON sample message: { "status": "ok", "items": [ { "node": { "id": 5, "name": "HUB_SLS", "type": "COMPANY", "availableForBooking": true, "device": false, "shortName": "HSLS" } }, { "node": { "id": 6, "name": "HQ1", "type": "SITE", "availableForBooking": true,… Read More Trouble deserializing a json array using newtonsoft – array returned but all elements = nothing

What C# data type would you de-serialize this Json into

Advertisements What kind of C# data type / List / Class would I de-serialise the following json into when the 3-character codes (ara, ces, cym, dei etc) are dynamic. Thanks! "translations":{ "ara":{"official":"مملكة هولندا","common":"هولندا"}, "ces":{"official":"Nizozemské království","common":"Nizozemsko"}, "cym":{"official":"Kingdom of the Netherlands","common":"Netherlands"}, "deu":{"official":"Niederlande","common":"Niederlande"}, "est":{"official":"Madalmaade Kuningriik","common":"Holland"} }" When I say dynamic – at run time you don’t know what… Read More What C# data type would you de-serialize this Json into