Skip to content

Commit 0143f52

Browse files
committed
Add F1 help for with
It now needs a disambiguation
1 parent 37965da commit 0143f52

3 files changed

Lines changed: 22 additions & 6 deletions

File tree

docs/csharp/language-reference/keywords/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ A contextual keyword provides a specific meaning in the code, but it isn't a res
166166
[`when` (filter condition)](when.md)
167167
[`where` (generic type constraint)](where-generic-type-constraint.md)
168168
[`where` (query clause)](where-clause.md)
169-
[`with`](../operators/with-expression.md)
169+
[`with`](with.md)
170170
[`yield`](../statements/yield.md)
171171
:::column-end:::
172172
:::row-end:::
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
description: "with - C# Reference"
3+
title: "`with` contextual keyword"
4+
ms.date: 02/06/2026
5+
f1_keywords:
6+
- "with"
7+
- "with_CSharpKeyword"
8+
helpviewer_keywords:
9+
- "with keyword [C#]"
10+
---
11+
12+
# `with` (C# reference)
13+
14+
Use the `with` keyword in the following contexts:
15+
16+
- In a [`with` expression](../operators/with-expression.md) to create a copy and apply modifications to one or more properties.
17+
- In a [collection expression](../operators/collection-expressions.md) to specify parameters to the constructor for the initialized collection.
18+
19+
## See also
20+
21+
- [C# Keywords](index.md)

docs/csharp/language-reference/operators/with-expression.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,6 @@
22
title: "The with expression - create new objects that are modified copies of existing objects"
33
description: "Learn about a with expression that performs nondestructive mutation of C# records and structures. The `with` keyword provides the means to modify one or more properties in the new object."
44
ms.date: 01/20/2026
5-
f1_keywords:
6-
- "with_CSharpKeyword"
7-
helpviewer_keywords:
8-
- "with expression [C#]"
9-
- "with operator [C#]"
105
---
116
# The `with` expression - Nondestructive mutation creates a new object with modified properties
127

0 commit comments

Comments
 (0)