how to solve getting null value in List after Deserialize JSON Object?

I want to get List of bills . I am getting data in response and content also. but after Deserialize the JSON object
bills = data.bill_details as List; in this line i am getting Null value.
Any suggestion please?

Tagged:

Answers

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    what is null? data.bill_details?

  • SwagatikaSwagatika Member ✭✭

    No bills is coming Null

  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭

    ?? Post your "content", the json

  • SwagatikaSwagatika Member ✭✭

    Now error is solved.
    i changed GetBills method in Result1 class and .
    And Here [ var data = JsonConvert.DeserializeObject(content);
    bills = data.result.bill_details as List>;] i changed
    var data=JsonConvert.DeserializeObject(content);
    bills = data.result.bill_details as List;. Now i am getting the proper Output.

  • SwagatikaSwagatika Member ✭✭


    this is my code.

  • NMackayNMackay GBInsider, University mod

    @Swagatika said:

    this is my code.

    Share a repo on github or a gist at least, doing an alt+printscreen is not sharing your code! Sharing the bit that you think is not working is not really a help (need to see the bigger picture....also a smaller reproduction of the problem in a smaller sample often leads you discover where you went wrong in my experience).

Sign In or Register to comment.