using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization.Formatters;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using Newtonsoft.Json.Linq;
using Newtonsoft.Json.Converters;
using Newtonsoft.Json.Serialization;
public partial class VoucherList
[JsonProperty("PaymentVoucherNumber")]
public long PaymentVoucherNumber { get; set; }
[JsonProperty("PaymentVoucherDate")]
public string PaymentVoucherDate { get; set; }
[JsonProperty("pvExpiryDate")]
public string PvExpiryDate { get; set; }
public decimal Amount { get; set; }
[JsonProperty("ReceiptNumber")]
public long ReceiptNumber { get; set; }
public static void Test()
VoucherList pv=new VoucherList();
JsonConvert.PopulateObject(json,pv);
Console.WriteLine("Input JSON: {0}", json);
Console.WriteLine("pv.Amount = {0}", pv.Amount);
var json = @"{""PaymentVoucherNumber"":15,""PaymentVoucherDate"":""2019-09-10T00:00:00"",""pvExpiryDate"":""2019-09-22T00:00:00"",""Amount"":35.000,""ReceiptNumber"":0}";
public static void Main()
Console.WriteLine("Environment version: {0} ({1})", System.Runtime.InteropServices.RuntimeInformation.FrameworkDescription , GetNetCoreVersion());
Console.WriteLine("Json.NET version: " + typeof(JsonSerializer).Assembly.FullName);
Console.WriteLine("Failed with unhandled exception: ");
public static string GetNetCoreVersion()
var assembly = typeof(System.Runtime.GCSettings).GetTypeInfo().Assembly;
var assemblyPath = assembly.CodeBase.Split(new[] { '/', '\\' }, StringSplitOptions.RemoveEmptyEntries);
int netCoreAppIndex = Array.IndexOf(assemblyPath, "Microsoft.NETCore.App");
if (netCoreAppIndex > 0 && netCoreAppIndex < assemblyPath.Length - 2)
return assemblyPath[netCoreAppIndex + 1];