Last active
October 31, 2018 02:33
-
-
Save rasikag/8b6418aa7c6f1a68e191201e27d20e6f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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