C# 7 and .NET Core Cookbook
上QQ阅读APP看书,第一时间看更新

Expression bodies for accessors, constructors, and finalizers

Expression-bodied members have been a big hit with the C# developer community, so much so that Microsoft has expanded the allowed members that can be implemented as expressions. You can now use this feature with:

  • Constructors
  • Finalizers (used when you need to release unmanaged code)
  • get and set accessors on properties and indexers