I have an F# library where I defined a module. Inside the module there are 2 types defined. I'm accessing the library from C# project (currently it's only a test project though that probably doesn't matter).
I can access one of the types from C# but the other one is not available.
Below my F# code:
module Stock
open FSharp.Data
open InstrumentQueryBuilder
type Stock = CsvProvider<"..\prototype_historical_data.csv">
type StockData(symbol) =
member this.Symbol = symbol
member private this.QueryBuilder = new InstrumentQueryBuilder(this.Symbol)
member this.LoadData() =
this.QueryBuilder.HistoricalData() |> Stock.Load
// more member definitions here...
From C# I can see StockData
but not Stock
. Stock
is CsvProvider
from FSharp.Data. In my C# code I'm referencing both FSharp.Data and FSharp.Core.
Using StockData
in C# is as simple as this:
var stockData = new Stock.StockData("SPY");
But if I do the same for Stock
it shows a compile time error. Any suggestion how to access the Stock
type or an explanation why that's not possible?