If you need a default constructor then there is a code snippet ctor
for it.
But if you need a constructor with parameters then in you code write:
User user = new User(2, "Name");
This will be an error, since there is no constructor with two parameters, but you will get a blue under line if you hover your mouse over User
in new User
. Click on that or put your cursor on User
and press Ctrl + .
It will give you an option to generate constructor like:

That will give you a constructor with fields like:
public class User
{
private int p1;
private string p2;
public User(int p1, string p2)
{
// TODO: Complete member initialization
this.p1 = p1;
this.p2 = p2;
}
public int Id { get; set; }
public string Name { get; set; }
}
Then you have to go in and remove p1
, p2
and point to Id
, Name
and also rename parameters in constructor. That is probably the best you can do with only Visual studio.
See: Generate From Usage - MSDN (thanks to @Peter Ritchie)
Consider installing Re-Sharper it has much better option for generating not only constructor but other very helpful code.