- 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;
}
推薦閱讀
- TypeScript入門與實戰
- iOS 9 Game Development Essentials
- Scratch真好玩:教小孩學編程
- Visual C++應用開發
- Learning Three.js:The JavaScript 3D Library for WebGL
- Getting Started with React Native
- Machine Learning With Go
- FPGA嵌入式項目開發實戰
- Sails.js Essentials
- 算法設計與分析:基于C++編程語言的描述
- 進入IT企業必讀的324個Java面試題
- INSTANT Apache ServiceMix How-to
- 深入理解Java虛擬機:JVM高級特性與最佳實踐
- Visual Basic語言程序設計上機指導與練習(第3版)
- SAS編程演義