c# json string how to get property code example
Example 1: json property C#
public class Videogame
{
[JsonProperty("name")]
public string Name { get; set; }
[JsonProperty("release_date")]
public DateTime ReleaseDate { get; set; }
}
Example 2: how to get properties from json in c#
var query = parsedStr.Descendants().OfType<JProperty>().Where(p => p.Value.Type != JTokenType.Array && p.Value.Type != JTokenType.Object);
foreach (var property in query)
Console.WriteLine(property);