Skip to content

Instantly share code, notes, and snippets.

@zHaytam
Last active July 3, 2020 10:50
Show Gist options
  • Save zHaytam/66a722f280798fef0c3d297fe7af0c9e to your computer and use it in GitHub Desktop.
Save zHaytam/66a722f280798fef0c3d297fe7af0c9e to your computer and use it in GitHub Desktop.
void Main()
{
var rect = new Rectangle(10, 5);
var widerRect = rect with { Width = 20 };
var longerRect = widerRect with { Height = 10 };
Console.WriteLine(rect.Equals(widerRect)); // False
Console.WriteLine(widerRect.Equals(longerRect)); // False
}
public record Rectangle(double Width, double Height);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment