Ejemplo n.º 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);
        }
Ejemplo n.º 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);
        }
Ejemplo n.º 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;
		}