Azure C# clients should also have CustomInitialize method
This is a follow-on to this issue: https://github.com/Azure/autorest/issues/789
When AutoRest generates a non-Azure C# client, the ServiceClient-derived class includes a partial CustomInitialize method. This would be really handy to have for Azure C# clients as well.
@jhancock93 FYI
@tbombach and I were just discussing this approach, and while it works for this case, we're not so sure that this is the best pattern to lay down for this type of enhancement.
We're leaning towards enabling a means of having the generator create the type as internal partial, and mark methods as virtual so that the developer can create a subclass of that and just use override methods to change what they'd like. We're kinda thinking that would be more flexible in the long run, rather than one-offing methods to customize individual methods as we go.
@fearthecowboy I disagree. The CustomInitialize method works great and is minimally invasive. With your proposal, we'd have to change the name of our client in our Swagger specs and introduce a new derived class just to make a few small customizations. This doesn't really make sense.
We're leaning towards enabling a means of having the generator create the type as internal partial ,
Also, this won't work because you can't have a public type inherit from an internal one.
Given that it's already in the one, I can see why we need to take this to let it work in the other.
Yeah, I forgot that there isn't any private inheritance in .NET. sigh
Merged.