[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Collapse]CodeRush
  System Requirements
  Improve Performance
 [Expand]Features by Language
 [Expand]Getting Started
 [Expand]How To
 [Collapse]Coding Assistance
  [Expand]Code Templates
  [Expand]Auto Completion
  [Expand]Clipboard Tools
  [Expand]Selection Tools
  [Collapse]Code Providers
   [Expand]Contract Providers
   [Expand]Declaration Providers
   [Expand]Implementation Providers
    Add Copyright Header
    Add Else Statement
    Add Getter/Setter
    Add Missing Constructors
    Add Parameter
    Add to Interface
    Add XML Comments
    Convert to Function
    Convert to Procedure
    Convert to Property With Change Notification/Introduce Change Notification
    Create Event Trigger
    Encapsulate Property
    Import Type/All Types (XAML)
    Initialize
    Introduce Format Item
    Introduce Setter Guard Clause
    Invert Selection
    Promote to Parameter
    XPO Fields
  [Expand]Declare Menu
  [Expand]Typing Helpers
 [Expand]Navigation and Search Tools
 [Expand]Static Code Analysis
 [Expand]Visualization Tools
 [Expand]Code Style Assistance
  Building Assistance
  Debugging Assistance
 [Expand]Refactoring Assistance
 [Expand]Unit Testing Assistance
 [Expand]Decompiling Tools
 [Expand]Configuration Options
 [Expand]Extensibility
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Convert to Procedure

Expanded Purpose

This Code Provider is used to convert a function that returns a value of the appropriate type into a method that returns void. It is useful for instance when you have added a parameter passed into a method by reference and don't need anything to be returned anymore.

Expanded Availability

Available when the caret is located on a non-void private method declaration. This method should have no references that use the returning value.

Expanded Usage

  1. Place the caret on a method's name or type assuming that it returns a value of any type.

    Note

    The blinking cursor shows the caret's position at which the Code Provider is available.

  2. Use the Ctrl + . or Ctrl + ~ shortcut to invoke the Code Actions Menu.
  3. Select Convert to Procedure from the menu.

After execution, the Code Provider changes the method's return type to void and removes the returned values from all return statements.

Note

This Code Provider is the opposite of Convert to Function

Is this topic helpful?​​​​​​​