ProviderContext GetDataContext() { var dataContext = CallContext.Current.GetObject <ProviderContext>(ObjectKey); if (dataContext == null) { if (string.IsNullOrEmpty(ConnectionString)) { dataContext = new ProviderContext(); } else { dataContext = new ProviderContext(ConnectionString); } CallContext.Current.RegisterObject <ProviderContext>(ObjectKey, dataContext); } return(dataContext); }
ProviderContext GetDataContext() { var dataContext = CallContext.Current.GetObject<ProviderContext>(ObjectKey); if (dataContext == null) { if (string.IsNullOrEmpty(ConnectionString)) { dataContext = new ProviderContext(); } else { dataContext = new ProviderContext(ConnectionString); } CallContext.Current.RegisterObject<ProviderContext>(ObjectKey, dataContext); } return dataContext; }