Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8398851
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T21:09:01+00:00 2026-06-09T21:09:01+00:00

I am setting a class in C# to hold a response that I will

  • 0

I am setting a class in C# to hold a response that I will be receiving from a web service call. I’m using RestSharp to handle the calling / parsing of the JSON data.

The web service documentation describes the response as:

OUTPUT: JSON object similar to example below.
    {
        "response":"[success] or [failed]",
        "messages":"Process succeeded.",
        "logonkey":"[logon key]",
        "tokenkey":"[security token]",
        "reccount":"1",
        "filelist":
            {
            "fileid":"12345",
            "status":"N",
            "filename":"data.tar",
            "fulfilled":"2012-06-15"
        }
    }

My question is how can I define the filelist array element in my class?

I was thinking something like this:

public class Files
{
    public string Response { get; set; }
    public string Messages { get; set; }
    public string LogonKey { get; set; }
    public string TokenKey { get; set; }
    public int RecordCount { get; set; }
    public List<FileList>
}

public class FileList
{
    public string FileID { get; set; }
    public string Status { get; set; }
    public string Filename { get; set; }
    public DateTime Fulfilled { get; set; }
}

However, I’m having a problem with the “public List” statement.

Any suggestions on the best way to handle this scenario would be appreciated.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T21:09:03+00:00Added an answer on June 9, 2026 at 9:09 pm

    The filelist in JSON sample doesn’t look like list of objects. Instead it is a single object.
    You could try,

    public class Files
    {
        public string Response { get; set; }
        public string Messages { get; set; }
        public string LogonKey { get; set; }
        public string TokenKey { get; set; }
        public int RecordCount { get; set; }
        public FileList File   {get; set; }
    }
    

    If you are sure the filelist in JSON is really list of object, you could try,

    public List<FileList> Files   = new List<FileList>();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In most cases, I've been setting an event class handler that will apply to
I have a class that requires dynamically setting a List. I also call this
I'm setting up a simple helper class to hold some data from a file
I'm setting up a class of public static vars that are to be BitmapData.
I m creating a class that extends AlertDialog. and setting layout. But when pop
i hava a class that hold a list for each request but each request
Im trying to create ini file that will hold me the configuration data, I
I want to make a class that can hold settings for my app. Its
A random class definition: class ABC: x = 6 Setting some values, first for
I have an abstract class which contains method for setting header text. It looks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.