Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

C# C# Streams and Data Processing Serialization Deserializing with Json.NET

help please

All my attempts fail..

Program.cs
using System; using System.IO; using System.Net;

namespace Treehouse.CodeChallenges { class Program { static void Main(string[] args) { Console.WriteLine(GetTreehouseHome()); }

    public static string GetTreehouseHome()
    {
        string treehouse = "";
        // Put code here
        using(WebClient webClient = new WebClient())
        {
            byte[] treehouseBytes = webClient.DownloadData("https://www.teamtreehouse.com");
            using(var stream = new MemoryStream(treehouseBytes))
            {
                using(var reader = new StreamReader(stream));
            }
        }





        return treehouse;
    }
}
}
WeatherForecast.cs
using System;

/* Sample JSON 

[
  {
    "weather_station_id": "HGKL8Q",
    "time_of_day": "06/11/2016 0:00",
    "condition": "Rain",
    "temperature": 53,
    "precipitation_chance": 0.3,
    "precipitation_amount": 0.03
  },
  {
    "weather_station_id": "HGKL8Q",
    "time_of_day": "06/11/2016 6:00",
    "condition": "Cloudy",
    "temperature": 56,
    "precipitation_chance": 0.08,
    "precipitation_amount": 0.01
  },
  {
    "weather_station_id": "HGKL8Q",
    "time_of_day": "06/11/2016 12:00",
    "condition": "PartlyCloudy",
    "temperature": 70,
    "precipitation_chance": 0,
    "precipitation_amount": 0
  },
  {
    "weather_station_id": "HGKL8Q",
    "time_of_day": "06/11/2016 18:00",
    "condition": "Sunny",
    "temperature": 76,
    "precipitation_chance": 0,
    "precipitation_amount": 0
  },
  {
    "weather_station_id": "HGKL8Q",
    "time_of_day": "06/11/2016 19:00",
    "condition": "Clear",
    "temperature": 74,
    "precipitation_chance": 0,
    "precipitation_amount": 0
  }
]
*/

namespace Treehouse.CodeChallenges
{
    public class WeatherForecast
    {
        public string WeatherStationId { get; set; }
        public DateTime TimeOfDay { get; set; }
        public Condition Condition { get; set; }
        public int Temperature { get; set; }
        public double PrecipitationChance { get; set; }
        public double PrecipitationAmount { get; set; }
    }

    public enum Condition
    {
        Rain,
        Cloudy,
        PartlyCloudy,
        PartlySunny,
        Sunny,
        Clear
    }
}