Properties

Values related to an object are represented by properties. In object-oriented programming, properties represent data associated with an instance of an object. The following snippet shows two types of property syntax:

// Property that has both get and set defined.[ attributes ][ static ] member [accessibility-modifier] [self-  identifier.]PropertyName    with [accessibility-modifier] get() =    get-function-body    and [accessibility-modifier] set parameter =    set-function-body// Alternative syntax for a property that has get and set.[ attributes-for-get ][ static ] member [accessibility-modifier-for-get] [self-identifier.]PropertyName =    get-function-body    [ attributes-for-set ]    [ static ] member [accessibility-modifier-for-set] [self-    identifier.]PropertyName ...

Get .NET Core 2.0 By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.