Edit

Share via


with (C# reference)

Use the with keyword in the following contexts:

  • In a with expression 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.

See also