What is new keyword in C# is immutable class?

If I had, I recently saw that in c# add new keyword and, if I remember correctly is a word with, but I absolutely can't find it. The point is that it is sugar for a method With which creates a copy of the current object with some modified parameters. I can RUB it in the manual or the news?
March 19th 20 at 08:54
1 answer
March 19th 20 at 08:56
What you are talking about, called Records (or entries), which has been successfully used in F#.
The question of when will be added support for them in C# is still open. Apparently in C# 8.0 will not be included. And then we will see as rumors circulated since the days of C# 6.0.

The proposal appears "with-expressions" which will allow you to write the following code:

e1 with { identifier = e2, ... }

and would be tantamount to

e1.With(identifier2, e2, ...)

For more information you can read here
Thank you, this is it. And with what version that syntax work?

public virtual Point With(int X = this.X, int Y = this.Y) => new Point(X, Y);
- Selena commented on March 19th 20 at 08:59
@Selena, you mean => methods? Since C# 6.0 - Laverna.Abernat commented on March 19th 20 at 09:02
@Laverna.Abernat, no, I mean int X = this.X in the arguments. - Selena commented on March 19th 20 at 09:05
@Selena, I honestly don't know what is currently valid code. Clarify and write. - Laverna.Abernat commented on March 19th 20 at 09:08

Find more questions by tags C#