Skip to content

Commit b039af1

Browse files
committed
convert-between-auto-property
1 parent e274924 commit b039af1

File tree

4 files changed

+43
-0
lines changed

4 files changed

+43
-0
lines changed
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
---
2+
title: Convert between auto property and full property
3+
ms.date: 03/27/2020
4+
ms.topic: reference
5+
author: mikadumont
6+
ms.author: midumont
7+
manager: jillfra
8+
dev_langs:
9+
- CSharp
10+
ms.workload:
11+
- "dotnet"
12+
---
13+
# Convert between auto property and full property
14+
15+
This refactoring applies to:
16+
17+
- C#
18+
19+
**What:** Convert between an auto-implemented property to a full property.
20+
21+
**When:** The logic of the property has changed.
22+
23+
**Why:** You can convert between an auto-implemented property to a full property manually, however this feature will automatically do the work for you.
24+
25+
## How-to
26+
27+
1. Place your cursor on the property name.
28+
2. Press **Ctrl**+**.** to trigger the **Quick Actions and Refactorings** menu.
29+
3. Select from the following two options:
30+
31+
Select **Convert to full property**.
32+
33+
![Convert auto property to full property](media/convert-auto-property-to-full-property.png)
34+
35+
Select **Use auto property**.
36+
37+
![Convert full property to auto property](media/convert-full-property-to-auto-property.png)
38+
39+
## See also
40+
41+
- [Refactoring](../refactoring-in-visual-studio.md)
Loading
Loading

docs/toc.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,8 @@
356356
href: ide/reference/convert-anonymous-type-to-class.md
357357
- name: Convert anonymous type to tuple
358358
href: ide/reference/convert-anonymous-type-to-tuple.md
359+
- name: Convert between auto property and full property
360+
href: ide/reference/convert-between-auto-property-and-full-property.md
359361
- name: Convert between for loop and foreach statement
360362
href: ide/reference/convert-for-loop-to-foreach.md
361363
- name: Convert between Get method and property

0 commit comments

Comments
 (0)