SqlConnectionContext Members
The SqlConnectionContext type exposes the following members.
Methods
| Name | Description | |
|---|---|---|
|
|
Clear |
Forcibly clears the ambient connection string on the current thread.
Defensive — use at the boundary of a long-lived operation (e.g., the end of a
background work item) to guarantee no leak into the next thread-pool caller in
the event a nested Scope(String) was not disposed correctly. Normal
Scope(String) usage already handles cleanup; Clear()()()() is for
paths where the scope contract may not have been honored.
|
|
|
Scope |
Sets the ambient connection string for the current thread for the lifetime of the
returned IDisposable. Nested scopes are honored — disposing restores
the value that was set before this scope opened (null at the top level).
|
Properties
| Name | Description | |
|---|---|---|
|
|
Ambient |
Current ambient connection string for this thread, or null/empty if none is set.
Read by GetConnectionString()()()() when no explicit connection string
has been assigned to the SQL instance.
|

