We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents accbfa9 + 8d201f9 commit 18e02e6Copy full SHA for 18e02e6
src/SqlClient.Tests/CreateCommand.fs
@@ -173,3 +173,17 @@ let CreareDynamicRecords() =
173
|> Seq.toArray
174
|> ignore
175
176
+
177
+[<Fact>]
178
+let ``connection is properly disposed`` () =
179
180
+ let mutable connection : SqlConnection = null
181
+ let mutable isDisposed = false
182
+ do
183
+ use cmd = DB.CreateCommand<"exec dbo.[Get]", ResultType.DataReader>()
184
+ connection <- (cmd :> ISqlCommand).Raw.Connection
185
+ connection.Disposed.Add(fun _ -> isDisposed <- true)
186
+ use reader = cmd.Execute()
187
+ ()
188
189
+ Assert.True isDisposed
0 commit comments