예제 #1
0
        public static IDataReader NewInstance(IDataReader dataReader)
        {
            IInterceptor handler = new IDataReaderProxy(dataReader);

            object proxyDataReader = new ProxyGenerator().CreateProxy(typeof(IDataReader), handler, dataReader);

            return((IDataReader)proxyDataReader);
        }
예제 #2
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="invocation"></param>
        /// <param name="arguments"></param>
        /// <returns></returns>
        public object Intercept(IInvocation invocation, params object[] arguments)
        {
            object returnValue = invocation.Method.Invoke(_command, arguments);

            if (invocation.Method.Name == "ExecuteReader")
            {
                if (_dataReaderLogger.IsDebugEnabled)
                {
                    returnValue = IDataReaderProxy.NewInstance((IDataReader)returnValue);
                }
            }

            return(returnValue);
        }
예제 #3
0
		public static IDataReader NewInstance(IDataReader dataReader)
		{
			IInterceptor handler = new IDataReaderProxy(dataReader);

			object proxyDataReader = new ProxyGenerator().CreateProxy(typeof(IDataReader), handler, dataReader);

			return (IDataReader)proxyDataReader;
		}