I have this base class that creates a new SQL Server connection and does some utility methods in C#, I want to inherit in F#. Currently I cannot access the protected fields in t
See related questions:
F# - How to access protected member
Why isn't there a protected access modifier in F#?
Basically I think you can't do it from within a let
because it's actually in the context of an implicit lambda.
You can add a self-identifier to the constructor:
type Transfer ( server : string, db : string ) as this =
inherit SQL(server, db)
let accessAbstractConn = this.conn
or, use the base
keyword:
type Transfer ( server : string, db : string ) =
inherit SQL(server, db)
let accessAbstractConn = base.conn