تعدادی از ویژگیهای پیشنهادی C# 9.0
نویسنده: وحید نصیری
تاریخ: ۱۳۹۸/۱۰/۱۲ ۷:۳۷
آدرس: www.dntips.ir
| مطالب | ۳۶۹۴ |
| نویسندگان | ۲۷۶ |
| گروههای مطالب | ۱۰۲۴ |
| نقشههای راه | ۱۱۹ |
| دورهها | ۱۴ |
| اشتراکها | ۱۷۹۱۴ |
// Before
public class Widget
{
private readonly int _foo;
private readonly WidgetConfiguration _config;
public Widget(int foo, WidgetConfiguration config)
{
_foo = foo;
_config = config;
}
}
// After
public class Widget
{
public Widget(int _foo, WidgetConfiguration _config)
{
// If you wanted one of these properties to be publicly accessible, you could define
// and set one of those here, otherwise the arguments will be privately accessible
// as fields.
}
}