C# Querying With LINQ Querying the BirdWatcher Data How Much Data Do We Have?

Radu - Adrian Buha
PRO
Radu - Adrian Buha
Pro Student 3,248 Points

Is there a better Workspace Alternative?

Hello,

I seem to have some problems lately with my workspace, especially on this video tutorial, I cannot seem to be able to type the last query from tutorial into my workspace REPL. I have already contacted Treehouse Support and I'm wainting on their response. In the meantime I was curios if there is a way I can use the Bird repository in Visual Studio's "C# Interactive", or is there another REPL solution that I can use?

Thanks, Radu

3 Answers

Andrew Parker
Andrew Parker
19,450 Points

I got this working in Visual Studio without using the BirdWatcher.dll. I believe it's just using the code in the BirdRepository.cs class anyway. You can download the workspace files by going to File > Download Workspace. Then in your Visual Studio project you can add these existing files / classes. Just make sure your main method class has the namespace BirdWatcher to match the others. Here was mine:

using System;
using System.Collections.Generic;
using System.Linq;

namespace BirdWatcher
{
    class Program
    {
        static void Main(string[] args)
        {
            var birds = BirdRepository.LoadBirds();
            Console.WriteLine(birds.Count());
        }
    }
}

Although this isn't for the REPL, at least you can play around with the commands she uses by printing them to the console using WriteLine.

Alec Meyer
Alec Meyer
6,204 Points

If you want to use the C# Interactive REPL via Visual Studio do as Andrew Parker suggested above by downloading the workspace. Then inside of the c# interactive window use the special #r (for reference command).

#r "c:\Users\YourUserName\Downloads\project\BirdWatcher.dll"

This will be the same as the LoadAssembly("path") that the instructor is using.

Curtis Vanzandt
Curtis Vanzandt
8,447 Points

You could download the free version of Visual Studio and save these tutorials on your computer! That way, you have the basic steps to look back on if need be.

Radu - Adrian Buha
Radu - Adrian Buha
Pro Student 3,248 Points

I already have the Visual Studio installed. My question was how do I load the Bird repository into Visual Studio's "C# Interactive"?