Exemplo n.º 1
0
        /// <summary>
        /// Creates service clients based on the Generic type TClass
        /// </summary>
        /// <typeparam name="TClass">The generic representation to the class</typeparam>
        /// <returns>The service class based on the generic type</returns>
        public static TClass CreateClient <TClass>() where TClass : new()
        {
            try
            {
                dynamic client = new TClass();
                client.ClientCredentials.Windows.ClientCredential = ServiceConfig.NetworkCredential();

                return(client);
            }
            catch (Exception e)
            {
                throw e;
            }
        }