Q:

RallyApi. Net Getting Workspaces from a Subscription Version 2.0

Following this link How to obtain a list of workspaces using Rally REST .NET
I tried the example however when I try to query against sub["Workspaces"] I get the error
RuntimeBinderException was unhandled;
The best overloaded method match for 'Rally. RestApi. RallyRestApi. Query(Rally. RestApi. Request)' has some invalid arguments
I cannot find any other ways to gather a list of workspaces from the subscription using the RallyApi dll for .Net which I obtained from the link provided. 
Any help will be much appreciated. 

A:

Try to modify that code as follows:
Request wRequest = new Request(sub["Workspaces"]);          
QueryResult queryResult = restApi. Query(wRequest);

Here is an entire app:
using System;
using System. Collections. Generic;
using System. Collections;
using System. Linq;
using System. Text;
using Rally. RestApi;
using Rally. RestApi. Response;

namespace Rest_v2._0_test
{
    class Program
    {
        static void Main(string[] args)
        {
            //Initialize the REST API
            RallyRestApi restApi;
            restApi = new RallyRestApi("user@co.com", "secret", "https://rally1.rallydev.com", "v2.0");

            //get the current subscription
            DynamicJsonObject sub = restApi. GetSubscription("Workspaces");

            Request wRequest = new Request(sub["Workspaces"]);

            //query the Workspaces collection
            QueryResult queryResult = restApi. Query(wRequest);

           foreach (var result in queryResult. Results)
            {
                var workspaceReference = result["_ref"];
                var workspaceName = result["Name"];
                Console. WriteLine( workspaceName + " " + workspaceReference);
            }
        }
    }
}

