public void Dispose() { if (_global != null) { _global.CloseConnection(); FSGlobalFactory.Put(_global); _global = null; } }
public FSScope(FSGlobalContext global) { if (global == null) { throw new ArgumentNullException(nameof(global)); } FSGlobalContext = FSGlobalFactory.Get(global.Identity); }
/// <summary> /// Puts the specified global. /// </summary> /// <param name="global">The global.</param> internal static void Put(FSGlobalContext global) { //identity = identity ?? NVUserContext.Identity; var pool = _globalPools.GetOrAdd(global.Identity.GetToken(), new Lazy <FSGlobalPool>(() => new FSGlobalPool(() => GenerateGlobal(global.Identity), BrokerSettings.Default.GlobalPoolSize) )); pool.Value.PutGlobal(global.FSGlobal); }
//private readonly Func<FSGlobal, T> _factory; public FSDataContext(INVIdentityProvider provider) { _global = FSGlobalFactory.Get(provider.Get); }
public object Create(Type type) { return(FSGlobalContext.Create(type)); }
public TFSEntity Create <TFSEntity>() where TFSEntity : class, IDevFrameworkObject { return(FSGlobalContext.Create <TFSEntity>()); }