{"action":"closed","issue":{"url":"https://api.github.com/repos/Azure/autorest/issues/385","labels_url":"https://api.github.com/repos/Azure/autorest/issues/385/labels{/name}","comments_url":"https://api.github.com/repos/Azure/autorest/issues/385/comments","events_url":"https://api.github.com/repos/Azure/autorest/issues/385/events","html_url":"https://github.com/Azure/autorest/issues/385","id":111066550,"number":385,"title":"(C#) AutoRest generates public constructors that leave ServiceClient in an unusable state","user":{"login":"brjohnstmsft","id":5523701,"avatar_url":"https://avatars.githubusercontent.com/u/5523701?v=3","gravatar_id":"","url":"https://api.github.com/users/brjohnstmsft","html_url":"https://github.com/brjohnstmsft","followers_url":"https://api.github.com/users/brjohnstmsft/followers","following_url":"https://api.github.com/users/brjohnstmsft/following{/other_user}","gists_url":"https://api.github.com/users/brjohnstmsft/gists{/gist_id}","starred_url":"https://api.github.com/users/brjohnstmsft/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brjohnstmsft/subscriptions","organizations_url":"https://api.github.com/users/brjohnstmsft/orgs","repos_url":"https://api.github.com/users/brjohnstmsft/repos","events_url":"https://api.github.com/users/brjohnstmsft/events{/privacy}","received_events_url":"https://api.github.com/users/brjohnstmsft/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/Azure/autorest/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-10-12T22:22:10Z","updated_at":"2015-11-06T15:03:12Z","closed_at":"2015-11-06T15:03:12Z","body":"AutoRest generates the following constructors in C# (using Azure Search's SearchServiceClient as an example):\r\n\r\n    public SearchServiceClient()\r\n    public SearchServiceClient(params DelegatingHandler[] handlers)\r\n    public SearchServiceClient(HttpClientHandler rootHandler, params DelegatingHandler[] handlers)\r\n    public SearchServiceClient(Uri baseUri, params DelegatingHandler[] handlers)\r\n    public SearchServiceClient(ServiceClientCredentials credentials, params DelegatingHandler[] handlers)\r\n    public SearchServiceClient(Uri baseUri, ServiceClientCredentials credentials, params DelegatingHandler[] handlers)\r\n\r\nMost of these constructors do not take `ServiceClientCredentials`, and the `Credentials` property is not publicly settable. It seems that the constructors that do not take credentials should be private or maybe protected.\r\n\r\nAlso, is there a way in the Swagger to specify a derived class of `ServiceClientCredentials`? It would be nice if the constructors that do take credentials could be as strongly-typed as possible.\n<!---@tfsbridge:{\"tfsId\":4996535}-->"}}