AdvantageCMS.Core.Common.BaseClasses Namespace
Build With Advantage

SqlConnectionContext Methods

The SqlConnectionContext type exposes the following members.

Methods


  Name Description
Public method Static member 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.
Public method Static member 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).