My problem is that I deserialize the incoming data and transfer it to this class using jsonproperty. but I don't want to use property name attribute that I use in jsonproperty while serializing.
example class
public class DocumentDetail
{
[JsonProperty("KAREKOD")]
public string qrCode { get; set; }
[JsonProperty("GTIN")]
public string gtinNumber { get; set; }
[JsonProperty("LOTNUMBER")]
public string lotNumber { get; set; }
}
example serialize
{
DocumentDetail docDetail=new DocumentDetail(){qrCode="123456adsfg789",gtinNumber ="123asdf548654",lotNumber ="1231231sdfg23"};
var obj=JsonConvert.SerializeObject(body);
}
example result
{
"qrCode" : "123456adsfg789",
"gtinNumber" : "123asdf548654",
"lotNumber" : "1231231sdfg23"
}