- ASP.NET Core 2 High Performance(Second Edition)
- James Singleton
- 73字
- 2021-07-08 09:39:00
More expression bodies
Expression bodies are expanded from the offering in C# 6, and you can now use them in more places, for example, as object constructors and property setters. Here, we extend our previous example to include the setting up of the value on the property we were previously just reading:
private static string text;
public static string Text
{
get => text ?? $"Today: {DateTime.Now:r}";
set => text = value;
}
推薦閱讀
- Python編程自學(xué)手冊
- C# 7 and .NET Core Cookbook
- 嵌入式軟件系統(tǒng)測試:基于形式化方法的自動化測試解決方案
- Servlet/JSP深入詳解
- PHP+MySQL+Dreamweaver動態(tài)網(wǎng)站開發(fā)實例教程
- Mastering Google App Engine
- INSTANT OpenNMS Starter
- Visual C#.NET程序設(shè)計
- Python Essentials
- BeagleBone Robotic Projects(Second Edition)
- Building Slack Bots
- Mastering HTML5 Forms
- 大話代碼架構(gòu):項目實戰(zhàn)版
- C++從零開始學(xué)(視頻教學(xué)版)(第2版)
- Responsive Web Design with HTML5 and CSS3(Second Edition)