Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Make connection param mandatory when literal conn str used at design time #195
At the moment there are 2 ctors on generated command types:
The fact that all parameters are optional for the second constructor allows to create instance of command without providing any parameters. In that case connection string provided at design time reused at run-time. This makes sense for config file based configuration e.g.
type Get42 = <"SELECT 42", "name=AdventureWorks">
But can lead to unintended mistakes when literal used at design time
type Get42 = <"SELECT 42", "Server=.;Database=AdventureWorks;Trusted_Connection=yes">
So proposal is to make connection instance mandatory parameter in second ctor if connection string literal provided at design time. Type signature of second ctor should be :
Based on feedback from @dsevastianov.