Sometimes auto implemented properties don't satisfy our requirement. So, we need to create full property declaration.
Do you feel it's time consuming? If, so check this cool feature.
1. Create property backing field. Ex: private string _name;
2. right click mouse and go to Refactor -> Encapsulate. Visual studio opens up a dialogue box. Set values accordingly. I prefer key board short cut Ctrl+R+E.
http://visualstudiomagazine.com/blogs/tool-tracker/2013/06/write-a-property-with-a-name-and-datatype.aspx
No comments:
Post a Comment