In this blog you will learn how to encapsulate field
and extract interface using Refactor.
First of all add a new class and declare a variable
email:
public class UserLog
{
private string email;
public
UserLog()
{
//
//
TODO: Add constructor logic here
//
}
}
Now
right click on email and select refactor and select Encapsulate Field.
Image
1.

Image
2.
And click
OK.
Image
3.
See you
class code now:
Private string email;
Public string Email
{
get { return email; }
set {
email = value; }


Join the conversation! Your thoughts help the community grow.