The requested page is not available for the requested platform. You are viewing the content for Default platform.

Declare Initialized Property (C#)

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; }