public string GetKeyFrom(object anObject)
 {
     if (SessionFactoryKeyManger.Instance().ContainsKey(Thread.CurrentThread.ManagedThreadId))
     {
         return(SessionFactoryKeyManger.Instance()[Thread.CurrentThread.ManagedThreadId]);
     }
     return(SessionFactoryAttribute.GetKeyFrom(anObject));
 }
 public string GetKey()
 {
     if (SessionFactoryKeyManger.Instance().ContainsKey(Thread.CurrentThread.ManagedThreadId))
     {
         return(SessionFactoryKeyManger.Instance()[Thread.CurrentThread.ManagedThreadId]);
     }
     return(NHibernateSession.DefaultFactoryKey);
 }
Ejemplo n.º 3
0
        public static SessionFactoryKeyManger Instance()
        {
            if (instance == null)
            {
                lock (syncLock)
                {
                    if (instance == null)
                    {
                        instance = new SessionFactoryKeyManger();
                    }
                }
            }

            return(instance);
        }