Aviral Kumar
Aviral Kumar

Reputation: 824

Storing values into the database from a deserialized variable

I am trying to store the values of a deserialized object in the database. My deserialized object is according to the image I uploaded.

I tried to implement IEnumerable and IEnumerator interfaces so that I can make my class foreach accessible.

public class Result:IEnumerable,IEnumerator

But then there is exception coming with my deserialization process.

enter image description here

Upvotes: 1

Views: 181

Answers (1)

Darin Dimitrov
Darin Dimitrov

Reputation: 1039368

You could loop through the Result.data property which is a collection:

Result soap = JsonConvert.DeserializeObject<Result>(ser);
foreach (var item in soap.data)
{
    ... do something with each element of the data collection
}

Upvotes: 2

Related Questions