- 2 minutes to read
This refactoring creates a lambda expression and inlines a referenced delegate. If there is only one reference to a delegate method, the Inline Lambda refactoring deletes the delegate method. Use this Refactoring to create the delegate in a lambda syntax.
This refactoring is available when the caret is in a method reference within a delegate creation statement.
How to Use
Place the caret in a method reference within a delegate creation statement. For example, in the “UserControl1_Loaded” method reference.
Press the Ctrl + . or Ctrl + ~ shortcut to invoke the Code Actions menu.
Select Inline Lambda from the menu.
After execution, this Refactoring creates a lambda expression and inlines the referenced delegate.