What's the difference?
Hello, can someone please tell me what the difference between the two methods is? // 1. class SampleClass { private int _sample; public int Sample { // Return the value stored in a field. get => _sample; // Store the value in the field. set => _sample = value; } } //2. class SampleClass { private int _sample; public int Sample { // Return the value stored in a field. get { return _sample; } // Store the value in the field. set { value = _sample; } } } I found this code while I was researching about classes and objects https://docs.microsoft.com/de-de/dotnet/csharp/programming-guide/concepts/object-oriented-programming (I think the web-page is German) I know that the 1.st method uses lambda expression, but is there any difference between the two Or is the 1.st method just better to read and write?