Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Product
- {
- private string name;
- private decimal cost;
- public Product(string name, decimal cost)
- {
- this.Name = name;
- this.Cost = cost;
- }
- public decimal Cost
- {
- get { return cost; }
- set
- {
- Validator.ValidatingMoney(value);
- cost = value;
- }
- }
- public string Name
- {
- get { return name; }
- set
- {
- Validator.ValidatingName(value);
- name = value;
- }
- }
- public override string ToString()
- {
- return name;
- }
- }
Add Comment
Please, Sign In to add comment