Ejemplo n.º 1
0
		private ISession GenerateProxy(ISession realSession, TransactionProtectionWrapper wrapper)
		{
			var wrapped = (ISession) proxyGenerator.CreateInterfaceProxyWithTarget(typeof (ISession),
			                                                                       Commons.SessionProxyInterfaces,
			                                                                       realSession,
			                                                                       wrapper);
			return wrapped;
		}
Ejemplo n.º 2
0
        private ISession GenerateProxy(ISession realSession, TransactionProtectionWrapper wrapper)
        {
            var wrapped = (ISession)proxyGenerator.CreateInterfaceProxyWithTarget(typeof(ISession),
                                                                                  Commons.SessionProxyInterfaces,
                                                                                  realSession,
                                                                                  wrapper);

            return(wrapped);
        }
Ejemplo n.º 3
0
		public ISession Wrap(ISession realSession, SessionCloseDelegate closeDelegate, SessionDisposeDelegate disposeDelegate)
		{
			if (IsWrapped(realSession))
			{
				return realSession;
			}

			var wrapper = new TransactionProtectionWrapper(realSession, closeDelegate, disposeDelegate);

			return GenerateProxy(realSession, wrapper);
		}
Ejemplo n.º 4
0
        public ISession Wrap(ISession realSession, SessionCloseDelegate closeDelegate, SessionDisposeDelegate disposeDelegate)
        {
            if (IsWrapped(realSession))
            {
                return(realSession);
            }

            var wrapper = new TransactionProtectionWrapper(realSession, closeDelegate, disposeDelegate);

            return(GenerateProxy(realSession, wrapper));
        }