diff --git a/ClientRuntimes/CSharp/Microsoft.Rest.ClientRuntime/ServiceClient.cs b/ClientRuntimes/CSharp/Microsoft.Rest.ClientRuntime/ServiceClient.cs index bba5be03f8..d33ab3bdee 100644 --- a/ClientRuntimes/CSharp/Microsoft.Rest.ClientRuntime/ServiceClient.cs +++ b/ClientRuntimes/CSharp/Microsoft.Rest.ClientRuntime/ServiceClient.cs @@ -210,48 +210,48 @@ protected void InitializeHttpClient(HttpClientHandler httpClientHandler, params HttpClient.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(type.FullName, GetClientVersion())); } - /// - ///A mehtod to set user agent - /// + + /// + /// Sets the product name to be used in the user agent header when making requests + /// + /// Name of the product to be used in the user agent public bool SetUserAgent(string productName) { - if(!_disposed && HttpClient != null) + if (!_disposed && HttpClient != null) { - /// - /// Dispose the the old useragent. - /// + // Clear the old user agent HttpClient.DefaultRequestHeaders.UserAgent.Clear(); HttpClient.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(productName, GetClientVersion())); - // returns true if the userAgent was added + + // Returns true if the user agent was set return true; } - /// - ///returns false if the httpclient was disposed before invoking the method - /// + + // Returns false if the HttpClient was disposed before invoking the method return false; } - /// - ///Another method to setuseragent and its version - /// - public bool SetUserAgent(string productName,string version) + + /// + /// Sets the product name and version to be used in the user agent header when making requests + /// + /// Name of the product to be used in the user agent + /// Version of the product to be used in the user agent + public bool SetUserAgent(string productName, string version) { - if(!_disposed && HttpClient != null) + if (!_disposed && HttpClient != null) { - /// - /// Dispose the the old useragent. - /// + // Clear the old user agent HttpClient.DefaultRequestHeaders.UserAgent.Clear(); - HttpClient.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(productName,version)); - /// - // returns true if the userAgent was added - /// + HttpClient.DefaultRequestHeaders.UserAgent.Add(new ProductInfoHeaderValue(productName, version)); + + // Returns true if the user agent was set return true; } - /// - /// returns false if the httpclient was disposed before invoking the method - /// + + // Returns false if the HttpClient was disposed before invoking the method return false; } + /// /// Gets the AssemblyInformationalVersion if available /// if not it gets the AssemblyFileVerion