1#if !NETSTANDARD2_0 && !NET5_0 && !NET6_0
11using System.Data.Linq;
35 [Obsolete(
"Use dependency injection",
false)]
39 private static object _lock =
new object();
41 private string _connectionString;
42 private string _label;
88 return GetManager(database, isDatabaseName,
"default");
110 var connection = ConfigurationManager.ConnectionStrings[database];
111 if (connection ==
null)
113 var conn = ConfigurationManager.ConnectionStrings[database].ConnectionString;
114 if (
string.IsNullOrEmpty(conn))
121 var contextLabel = GetContextName(database, label);
141 _connectionString = connectionString;
147 private static string GetContextName(
string connectionString,
string label)
149 return "__ctx:" + label +
"-" + connectionString;
163#region Reference counting
165 private int _refCount;
173 get {
return _refCount; }
176 private void AddRef()
Provides consistent context information between the client and server DataPortal objects.
object CreateInstanceDI(Type objectType, params object[] parameters)
Creates an object using 'Activator.CreateInstance' using service provider (if one is available) to po...
ApplicationContext(ApplicationContextAccessor applicationContextAccessor)
Creates a new instance of the type
ContextDictionary LocalContext
Returns the application-specific context data that is local to the current AppDomain.
Provides an automated way to reuse LINQ data context objects within the context of a single data port...
int RefCount
Gets the current reference count for this object.
ContextManager< C > GetManager(string database, bool isDatabaseName, string label)
Gets the ContextManager object for the specified database.
void Dispose()
Dispose object, dereferencing or disposing the context it is managing.
C DataContext
Gets the LINQ data context object.
ContextManager< C > GetManager(string database, string label)
Gets the ContextManager object for the specified database.
ContextManager< C > GetManager(string database)
Gets the ContextManager object for the specified database.
ContextManager< C > GetManager(string database, bool isDatabaseName)
Gets the ContextManager object for the specified database.
A strongly-typed resource class, for looking up localized strings, etc.
static string DatabaseNameNotFound
Looks up a localized string similar to Database name not found in config file ({0}).