コード例 #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>());
 }