Q:

How to use a console application to execute methods from an api?

I want to create a console application that can execute just a few of my methods from an API in order to make it easier for people to understand how these methods work. What is the best way to take a user input, and then display output data.
Here is what I have so far:
public class SampleProgram
{
    private readonly IRestClient _client;
    private const string vTruckUrl = "api/trucktype";

    public SampleProgram(string serviceUrl)
    {
        _client = new RestClient(serviceUrl);
    }

    public List<TruckType> GetVisionTruckType(string orderItemNumber) 
    //TruckType is a simple model containting two strings.
    {
        var request = new RestRequest(vTruckUrl, Method.GET)
        {
            RequestFormat = DataFormat.Json
        };

        request.AddParameter("orderItemNumber", orderItemNumber);

        var response = _client.Execute<List<VisionTruckType>>(request);
        if (response.StatusCode == System.Net.HttpStatusCode.OK)
            return response.Data;

        throw new Exception("The truck type and job name could not be queried.");
    }
}

Console:
public class ConsoleProgram
{

    private static SampleProgram _service = new SampleProgram("https://mytesturl.com/");
    static void Main(string[] args)
    {
        Console.WriteLine("");
        Console.WriteLine("1" = GetVisionTruckType Method");
        Console.WriteLine("");
        Console.WriteLine("Select the number that correlates to the Method that you want to execute: ");

        string methodNumber = string.Empty;
        while (methodNumber == string.Empty)
        {

            methodNumber = Console.ReadLine();
            if (!(methodNumber == "1"))
            {
                methodNumber = string.Empty;
                Console.WriteLine("Invalid input.");
                Console.WriteLine("Select the number that correlates to the Method that you want to execute: ");
            }
            switch (methodNumber)
            {

                case "1":
                    Console.WriteLine("Please enter a valid order item number: ");
                    string num = Console.ReadLine();
                    var type = _service.GetVisionTruckType(num);
                    Console.WriteLine(type.ToString());
                    break;

            }
            Console.Read();
        }
    }
 }

My program is not outputting a list as I want it to. How do I fix this?

A:

This is incorrect:
var type = _service.GetVisionTruckType(num);
Console.WriteLine(type.ToString());

By default, ToString() will return the name of the type itself on reference types.  (After all, how would the system know for any arbitrary class what you expect the string representation of that class to be?)
You would need to print whatever it is you want to print from that type object.  (Which really should be called types, since it's a collection, by the way.  Bad naming adds to the confusion you're experiencing.)  For example:
var type = _service.GetVisionTruckType(num);
foreach (var obj in type)
    Console.WriteLine(obj.SomeProperty);

That would print the value of SomeProperty on each element in that collection.
Whatever you want to print is up to you.  The point is that C# isn't going to know what you want just by calling ToString(), you have to tell it explicitly.

Conversely, you could override ToString() on any class you control:
public override string ToString()
{
    // build and return what you want a string representation of this object to be
}

That would allow you to consistently call ToString() on objects of that type and get the string representation you expect.

