Comments on: C# Intermediate – Properties https://code-maze.com/csharp-properties/ Learn. Code. Succeed. Thu, 27 Aug 2020 10:32:05 +0000 hourly 1 https://wordpress.org/?v=6.7.5 By: Marinko https://code-maze.com/csharp-properties/#comment-404 Sat, 22 Sep 2018 11:00:00 +0000 https://code-maze.com/?p=4458#comment-404 In reply to Florian Zrenner.

Hello Florian. Thank you for your suggestion, but this is just different way to write the same thing (method or prop with just one line inside the body), so called lambda expression statements. The result is the same. It is all up to you how you want to write it, as long as your property or method has just one single line inside.

All the best.

]]>
By: Florian Zrenner https://code-maze.com/csharp-properties/#comment-403 Sat, 22 Sep 2018 10:22:00 +0000 https://code-maze.com/?p=4458#comment-403 I think a “new” common way for properties is missing

public string Name
{
get => _name;
set => _name = value;
}

or

public string FullName => $”{_firstName} {_lastName}”;

https://docs.microsoft.com/de-de/dotnet/csharp/programming-guide/classes-and-structs/properties

]]>