Exemple #1
0
        /// <summary>
        /// Static constructor
        /// </summary>
        /// <param name="connection">The connection which been proxified.</param>
        /// <param name="provider">The provider used</param>
        /// <returns>A proxy</returns>
        internal static IDbConnection NewInstance(IDbConnection connection, Provider provider)
        {
            object       proxyConnection = null;
            IInterceptor handler         = new IDbConnectionProxy(connection, provider);

            ProxyGenerator proxyGenerator = new ProxyGenerator();

            proxyConnection = proxyGenerator.CreateProxy(typeof(IDbConnection), handler, connection);

            return((IDbConnection)proxyConnection);
        }
		/// <summary>
		/// Static constructor
		/// </summary>
		/// <param name="connection">The connection which been proxified.</param>
		/// <param name="provider">The provider used</param>
		/// <returns>A proxy</returns>
		internal static IDbConnection NewInstance(IDbConnection connection, Provider provider)
		{
			object proxyConnection = null;
			IInterceptor handler = new IDbConnectionProxy(connection, provider);

			ProxyGenerator proxyGenerator = new ProxyGenerator();

			proxyConnection = proxyGenerator.CreateProxy(typeof(IDbConnection), handler, connection);

			return (IDbConnection) proxyConnection;
		}