Abstract properties

Abstract properties have no implementation and are fully abstract. They can be virtual. It should not be private and if one accessor is abstract all others must be abstract. The following is an example of the abstract property and how to use it:

// Abstract property in abstract class.// The property is an int type that has a get and// set method[<AbstractClass>]type AbstractBase() =   abstract Property1 : int with get, set// Implementation of the abstract propertytype Derived1() =   inherit AbstractBase()   let mutable value = 10   override this.Property1 with get() = value and set(v : int) = value    <- v// A type with a "virtual" property.type Base1() =   let mutable value = 10   abstract Property1 : int with get, set default this.Property1 ...

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.