Re[3]: Про рекорды
От: Serginio1 СССР https://habrahabr.ru/users/serginio1/topics/
Дата: 16.09.20 16:13
Оценка: 70 (1)
Здравствуйте, IT, Вы писали:

IT>Здравствуйте, Serginio1, Вы писали:


S>>Про рекорды


IT>Что-то я не вижу, деконструктор они туда прикрутили?

https://docs.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-9
The compiler produces a Deconstruct method for positional records. The Deconstruct method has parameters that match the names of all public properties in the record type. The Deconstruct method can be used to deconstruct the record into its component properties:
public record Person(string FirstName, string LastName);
var person = new Person("Bill", "Wagner");

var (first, last) = person;
Console.WriteLine(first);
Console.WriteLine(last);
и солнце б утром не вставало, когда бы не было меня
Отредактировано 16.09.2020 16:16 Serginio1 . Предыдущая версия .
 
Подождите ...
Wait...
Пока на собственное сообщение не было ответов, его можно удалить.