Automatically use object initializers during code cleanup

Is it possible to configure R# so that object initializers are automatically used during a code cleanup?


myParam = new SqlParameter();
myParam.ParameterName = "email";
myParam.SqlDbType = SqlDbType.NVarChar;
myParam.Value = user.Email;

I want this during a code cleanup automatically reformatted to:

myParam = new SqlParameter
    ParameterName = "email",
    SqlDbType = SqlDbType.NVarChar,
    Value = user.Email

Right now I have to do this manually in a large files.

Please sign in to leave a comment.