- List item
I converted and stripped all the namespaces from the xml file and converted to Json object and below is my file in jobject This is what I do to get the returned Env object but it returned null.
Can you please help pointing out what were missing in my models? I have been doing different routes without success :(
var jsonObject =
JObject.Parse(Newtonsoft.Json.JsonConvert.SerializeXNode(XDocument.Parse(responseRet)));
var Env= Newtonsoft.Json.JsonConvert.DeserializeObject<Envelope>(jsonObject.ToString());
```
This is my classes:
public class SearchRecords_V2 { public List<SearchTXRecord_V2> SearchTXRecord_V2 { get; set; } }
public class SearchTXRecord_V2 { [DataMember] public int SearchTXRecordID { get; set; } [DataMember] public string FirstName { get; set; } [DataMember] public string MiddleName { get; set; } [DataMember] public string LastName { get; set; } [DataMember] public string Suffix { get; set; } [DataMember] public string SSN { get; set; } [DataMember] public string Address { get; set; } [DataMember] public string City { get; set; } [DataMember] public string State { get; set; } [DataMember] public string PostalCode { get; set; } [DataMember] public string ComponentID { get; set; } [DataMember] public string Status { get; set; } [DataMember] public string Created { get; set; } }
jsonisn't valid. What I would do, is createc#classes that would represent thisjsonand then you could deserialize this easily and perform any search you want. There are many json to c# online generators that would help you create these classes, here are a few: JSON2CSharp and QuickType. Can you tell us how thejsonis serialized, are you getting it this way and or are you creating it?