Guest User

Test HVF jaoks

a guest
Mar 13th, 2012
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.68 KB | None | 0 0
  1. namespace HVTest
  2. {
  3.     using System;
  4.     using System.Collections.Generic;
  5.  
  6.     class Program
  7.     {
  8.         public static WeatherData _weatherData;
  9.  
  10.         static void Main(string[] args)
  11.         {
  12.             _weatherData = new WeatherData();
  13.  
  14.             _weatherData.Weathers.Add(new Weather() { Name = "First" });
  15.             _weatherData.Weathers.Add(new Weather() { Name = "Second" });
  16.  
  17.             foreach (var item in _weatherData.Weathers)
  18.             {
  19.                 Console.WriteLine(item.Name);
  20.             }
  21.  
  22.             Console.Read();
  23.         }
  24.     }
  25.  
  26.     class WeatherData
  27.     {
  28.         public WeatherData()
  29.         {
  30.             Weathers = new List<Weather>();
  31.         }
  32.         public List<Weather> Weathers { get; set; }
  33.     }
  34.  
  35.     class Weather
  36.     {
  37.         public string Name { get; set; }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment