/
aprogrammer
/
dotnet-docs
Обзор
Документация
Войти
/
aprogrammer
/
dotnet-docs
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
main
docs/csharp/programming-guide/classes-and-structs/snippets/properties/TimePeriod.cs
37 строк
570 B
Bill Wagner
Update documents for `field` backed properties (#43261)
13 ноя 2024, 14:41
Не верифицирован
13 ноя 2024, 14:41
8aeac83
Код
Авторство
О чём код?
namespace properties; //<UsingExample> public class Date { private int _month = 7; // Backing store public int Month { get => _month; set { if ((value > 0) && (value < 13)) { _month = value; } } } } //</UsingExample> //<FieldExample> public class DateExample { public int Month { get; set { if ((value > 0) && (value < 13)) { field = value; } } } } //</FieldExample>