.net Octopus.Client issue with getting projects for a projectgroup

I am using the .net Octopus.Client nuget package v3.3.2 in a c# solution to pull all projects from a couple of projectgroups we have and display the latest versions deployed to our production environment. The issue in the code below is that the commented out code below throws an error (see attached image). This is using the octopusrepository class. if i use the octopusclient class as is done in the next line, i can get all the projects for the specified projectgroup. any ideas on what this error means? or is there a bug?

        var projectGroup = projectGroups.FirstOrDefault(a => a.Name == "Websites");
        //var projects1 = repository.ProjectGroups.GetProjects(projectGroup); //TODO: figure out why this doesnt work
        var projects = client.Get<ResourceCollection<ProjectResource>>($"api/projectgroups/{projectGroup.Id}/projects").Items;


Hi Kirk,

Thanks for reaching out. The repository.get method only returns a single resource.

The right way to do this is:

var apiKey = "";
var octopusURL = "";

var endpoint = new OctopusServerEndpoint(octopusURL, apiKey);
var repository = new OctopusRepository(endpoint);

var projectGroup = repository.ProjectGroups.FindByName("websites");            

var projects = repository.ProjectGroups.GetProjects(projectGroup);