Skip to main content

Declare Initialized Property (C#)

In This Article

Adds an auto-implemented property for the current parameter, and assigns the parameter value to this property. Creates linked identifiers for the generated property references and drops a marker onto the initial method parameter declaration.

Note

The code provider is only available for .NET framework 3.5 or higher.

#Availability

From the context menus or via shortcuts:

  • when the edit cursor or caret is on a method parameter.

#Example

private Type TestMethod(Object param)
{

}

Result:

private Type TestMethod(Object param)
{
    Param = param;
}
public Object Param { get; set; }