Skip to content

Instantly share code, notes, and snippets.

@rasikag
Last active October 31, 2018 02:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rasikag/8b6418aa7c6f1a68e191201e27d20e6f to your computer and use it in GitHub Desktop.
Save rasikag/8b6418aa7c6f1a68e191201e27d20e6f to your computer and use it in GitHub Desktop.
class Product
{
public string Name { get; private set; }
public decimal Price { get; private set; }
public Product(string name, decimal price)
{
Name = name;
Price = price;
}
public static List<Product> GetSampleProducts()
{
return new List<Product>
{
new Product { Name="West Side Story",Price=9.99m },
new Product { Name="Assassins", Price=14.99m },
new Product { Name="Frogs", Price=13.99m },
new Product { Name="Sweeney Todd", Price=10.99m}
};
}
public override string ToString()
{
return string.Format("{0}: {1}", Name, Price);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment