Closed dmitry-a-morozov closed 9 years ago
What do you mean by "instance"? thanks
One of the possible designs for FSharp.Data.SqlClient is to have factory method with static type provider parameters:
type AdventureWorks = SqlClient<"... connection info...">
let cmd = AdventureWorks.GetCommand<"SELECT * from Person.Person WHERE Title = @Title">()
//GetCommand above should accept optional SqlConnection instance and/or SqlTransaction instance
let xs = cmd.Execute(Title = "Engineer")
Question what's a type of xs
? In current implementation it's seq<MyCommandType.Record>
where MyCommandType.Record
is provided erased type.
I played a little more with the feature. I understand it a little better. I'm closing this issue and will open more specific #2.
Is it possible to return instance of provided type from https://github.com/dsyme/SampleMethStaticParamProvider/blob/master/src/SampleMethStaticParamProvider/TypeProvider.fs#L35 ?
Most likely I will need to return Provided Type itself but I want to try instance first.