AdvantageCMS.Core.Common.BaseClasses Namespace
Build With Advantage

SqlConnectionContext..::..Scope Method

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).

Namespace:  AdvantageCMS.Data
Assembly:  AdvantageCMS.Data (in AdvantageCMS.Data.dll)

Syntax


public static IDisposable Scope(
	string connectionString
)

Parameters

connectionString
Type: String
The connection string to push.

Return Value

An IDisposable that restores the previous ambient on Dispose. Always wrap in a using block so Dispose runs even on exception.