You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At the moment there are 2 ctors on generated command types:
connection: string * ?commandTimeout: int -> 'Command.
?connection: SqlConnection * ?transaction: SqlTransaction * ?commandTimeout: int -> 'Command.
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.
typeGet42=<"SELECT 42","name=AdventureWorks">
But can lead to unintended mistakes when literal used at design time
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 :
`connection: SqlConnection * ?transaction: SqlTransaction * ?commandTimeout: int ->
At the moment there are 2 ctors on generated command types:
connection: string * ?commandTimeout: int -> 'Command
.?connection: SqlConnection * ?transaction: SqlTransaction * ?commandTimeout: int -> 'Command
.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.
But can lead to unintended mistakes when literal used at design time
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 :
`connection: SqlConnection * ?transaction: SqlTransaction * ?commandTimeout: int ->
Based on feedback from @dsevastianov.
The text was updated successfully, but these errors were encountered: