Expression-bodied properties - CSharp Custom Type

CSharp examples for Custom Type:Property

Introduction

You can declare a read-only property as an expression-bodied property.

A arrow replaces all the braces and the get and return keywords:

public decimal Worth => currentPrice * sharesOwned;

Related Tutorials