- 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;
}
推薦閱讀
- 零基礎學Visual C++第3版
- Microsoft Exchange Server PowerShell Cookbook(Third Edition)
- Pandas Cookbook
- Learning Chef
- SEO實戰密碼
- Banana Pi Cookbook
- MongoDB權威指南(第3版)
- Python算法從菜鳥到達人
- Frank Kane's Taming Big Data with Apache Spark and Python
- PHP編程基礎與實踐教程
- 從零開始學Android開發
- 大學計算機基礎實訓教程
- Learning Image Processing with OpenCV
- 算法超簡單:趣味游戲帶你輕松入門與實踐
- Getting Started with hapi.js