using System.Collections.Generic;
public static void Main()
Product product = new Product("Don",9.99M);
Console.WriteLine("You name is " + product.Name + " and you have " + product.Price.ToString());
Console.WriteLine(product.ToString());
private set {name = value;}
private set {price = value;}
public Product(string name, decimal price)
public static List<Product> GetSampleProducts()
List<Product> list = new List<Product>();
list.Add(new Product("West Side Story", 9.99M));
list.Add(new Product("Assassins",14.99M));
list.Add(new Product("Frogs",13.99M));
list.Add(new Product("Sweeney Todd", 10.99M));
public override string ToString()
return string.Format("{0}: {1}",name,price);