using System.Text.Json.Serialization;
public static void Main()
""productIdserialNo"":""productIdtest""
var deserializeOptions = new JsonSerializerOptions{
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
var obj = JsonSerializer.Deserialize<DeviceRecord>(str,deserializeOptions);
Console.WriteLine(obj.IccId);
var test = new DeviceRecord();
var serializeOptions = new JsonSerializerOptions{
PropertyNamingPolicy = JsonNamingPolicy.CamelCase,
var obj1 = JsonSerializer.Serialize(test,serializeOptions);
public class DeviceRecord
[JsonPropertyName("serialNo")]
public string SerialNo { get; set; }
[JsonPropertyName("imei")]
public string Imei { get; set; }
[JsonPropertyName("iccId")]
public string IccId { get; set; }
[JsonPropertyName("productId")]
public string ProductId { get; set; }