Last week I told you guys about, Extract Method. Today I am going to talk about Encapsulate Field in Refactor.
Encapsulation is very essintial part of OOPS. You can eaily encapsulate your field in VS.net using your Refactor option.
Its very simple to Encapsulate the field in VS.net you just need to right click on field – refactor – encapsulate field.
After this the output is like,
14 private bool _isValid;
15
16 public bool IsValid1
17 {
18 get { return _isValid; }
19 set { _isValid = value; }
20 }
So you’ll have no troubles implementing Encapsulation in your code. VS.Net does this all for you.
Enjoy Coding!!!
</div>