Question: I have seen this kind of code in c#:

```
  private int id {get;set;}

```

but I would only create getter for the field cause if there is get and set for it is the same as public field **is the only way is**:

```
public int getId(){return id;}

```

How to automaticly generate only getters in VS2010

Answer: 
What you have implemented is known as an `Automatic Property` they look like this:

```
private string Name { get; set; }

```

Automatic properties merely *syntactical sugar* and in reality, provide a succinct, quick way to implement this code:

```
private string _name;
public string Name 
{ 
    get { return _name; } 
    set { _name = value; } 
}

```

You could disregard automatic properties, using manual proeprties and simply remove the `get`. Or use automatic properties and make the property's value read only to external members by marking the `get` with the private access modifier:

```
public string Name { get; private set; }

```

The code you say you would usually use, is never really needed in C# because properties, in reality are just methods in disguise and should be used as a better convention:

```
public int getId(){return id;} //bad

```
right click on the field, refactor, encapsulated field