Hi all,
I am trying to work on API service for our ERP system Invenotry function, need make use of nested Json structure to pass values:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Newtonsoft.Json;
namespace NDYAPI
{
public class StockAdj
{
public string doc_format = "YYMM";
public string coy_code;
public string doc_type;
public string status_code = "P";
public string requester_code;
public string requester_name;
public DateTime requested_date;
public string invoice_code = "";
public int doi_num = 0;
public string remarks;
public string reason_code;
public int item_count;
public StockAdjitem[] adjitems;
}
public class StockAdjitem
{
public int item_num;
public string trans_type;
public string prod_code;
public string prod_to;
public string part_code;
public string part_to;
}
}
While incurring "Exception Thrown" with "System.NullReferenceException: Object reference not set to an instance of an object." when setting the value to nested sub items.
am i missed something with the class defination ?
Thank you.
Zhang
Thank you very much, it is working now.
Regards,
Zhang