hey if I am returning json data from an API how do I assign the json data to my DTO? Meaning if I have a DTO that looks like this
public class TestDTO{ public Data data { get; set; }}public class Data{ public string fname { get; set; } public string lname { get; set; } public string phonenNumber { get; set; }}
public class TestDTO{ public Data data { get; set; }}public class Data{ public string fname { get; set; } public string lname { get; set; } public string phonenNumber { get; set; }}
but I only want to assign a value to
fname
fname
and
lname
lname
how would I set that up?
TestDTO td = null;//code heretd = new TestDTO{ //how do I get to fname here?};
TestDTO td = null;//code heretd = new TestDTO{ //how do I get to fname here?};