using EVCB_OCPP.Packet.Messages.Core; using Newtonsoft.Json; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace ConsoleApp1 { class Program { static void Main(string[] args) { var aa = new StopTransactionRequest() { meterStop=1, timestamp=DateTime.Now, transactionId=1 }; string tt = JsonConvert.SerializeObject(aa, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore }); var rr = JsonConvert.DeserializeObject(tt ); } } }