By using automatic properties, I save myself some typing, create code that is easier to read but still preserves the flexibility that a
property provides. If the day comes when I need to change the way a property is implemented, I can return to the regular
property format. As a demonstration, Listing 4-7 shows what I would have to do if I needed to change the way the Name
property is composed.
Create and populate product in 2 ways
the first one
| the second way |
No comments:
Post a Comment