/// <summary>
            /// Initializes a new instance of the <see cref="WcfClientConnection"/> class.
            /// </summary>
            /// <param name="owner">The pool object owning this connection.</param>
            /// <param name="client">The service client object for this connection.</param>
            public WcfClientConnection(
                WcfClientConnectionPool <TService> owner,
                TService client)
            {
                Debug.Assert(owner != null);
                Debug.Assert(client != null);

                _owner  = owner;
                _client = client;
            }
Пример #2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="RestServiceClient&lt;TService&gt;"/> class.
        /// </summary>
        /// <param name="channelFactory">The reference to the channel factory instance
        /// to be used for creating communication channels for the REST service.</param>
        /// <param name="serviceTitle">The title of the REST service.</param>
        /// <param name="exceptionHandler">Exception handler.</param>
        /// <exception cref="ArgumentNullException"><paramref name="channelFactory"/> or
        /// <paramref name="serviceTitle"/> is a null reference.</exception>
        public RestServiceClient(
            ChannelFactory <TService> channelFactory,
            string serviceTitle,
            IServiceExceptionHandler exceptionHandler)
        {
            CodeContract.RequiresNotNull("channelFactory", channelFactory);
            CodeContract.RequiresNotNull("serviceTitle", serviceTitle);
            CodeContract.RequiresNotNull("exceptionHandler", exceptionHandler);

            _connectionPool   = new WcfClientConnectionPool <TService>(channelFactory);
            _serviceTitle     = serviceTitle;
            _exceptionHandler = exceptionHandler;
        }