예제 #1
0
 public void Dispose()
 {
     if (_global != null)
     {
         _global.CloseConnection();
         FSGlobalFactory.Put(_global);
         _global = null;
     }
 }
예제 #2
0
        public FSScope(FSGlobalContext global)
        {
            if (global == null)
            {
                throw new ArgumentNullException(nameof(global));
            }

            FSGlobalContext = FSGlobalFactory.Get(global.Identity);
        }
예제 #3
0
        /// <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);
        }
예제 #4
0
 //private readonly Func<FSGlobal, T> _factory;
 public FSDataContext(INVIdentityProvider provider)
 {
     _global = FSGlobalFactory.Get(provider.Get);
 }
예제 #5
0
 public object Create(Type type)
 {
     return(FSGlobalContext.Create(type));
 }
예제 #6
0
 public TFSEntity Create <TFSEntity>()
     where TFSEntity : class, IDevFrameworkObject
 {
     return(FSGlobalContext.Create <TFSEntity>());
 }