5.1.1 Use Automatic Properties
This commit is contained in:
parent
ddbaeaa84f
commit
d848d67310
@ -21,11 +21,16 @@ namespace automatically_implemented_properties
|
|||||||
public class Product
|
public class Product
|
||||||
{
|
{
|
||||||
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; }
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user