5.1.1 Use Automatic Properties

master
Jason Zhu 2021-07-05 15:38:10 +10:00
parent ddbaeaa84f
commit d848d67310
1 changed files with 6 additions and 1 deletions

View File

@ -22,10 +22,15 @@ namespace automatically_implemented_properties
{ {
private string name; private string name;
public int ProductID { get; set; }
public string Name public string Name
{ {
get { return name; } get { return ProductID + name; }
set { name = value; } set { name = value; }
} }
public string Description { get; set; }
public decimal Price { get; set; }
public string Category { set; get; }
} }
} }