I have three txt files which contain the same Json data i want to read them all in c# class objects and overwrite all the objects from a textbox value in all the files at the same time
in short i have these fields common in all three text files
"time":"112429",
"code":"R123",
i want store their values in the c# object class from all three files at a time
and then overwrite the same object values supplied by a textbox value for all the attributes read by three different files
code to read single file data
using (FileStream fs = new FileStream(path, FileMode.Open, FileAccess.Read))
{
_orderRequest = (OrderRequest)JsonReader.ReadRecord(fs, _recordManager, TicketingRecordNames.OrderRequest);
}
my object class
public class OrderRequest
{
public string org;
public string raff;
public string time;
public string user;
public OrderRequest _orderRequest;
}
FILE 1 data
{
"org":"OrgTest",
"raff":"Raffle1",
"time":"112828",
"user":"User1",
}
FILE 2 data
{
"org":"OrgTest",
"raff":"Raffle1",
"time":"112828",
"user":"User111",
}
What I have tried:
i have tried newtonsoft json package serializing but not able to load multiple json text files to read, as well as cannot overwrite the object values of multiple files