Use the with keyword in the following contexts:
- In a
withexpression to create a copy and apply modifications to one or more properties. - In a collection expression to specify parameters to the constructor for the initialized collection.
with - C# Reference
Use the with keyword in the following contexts:
with expression to create a copy and apply modifications to one or more properties.