Varying Parameter Names in Method Overloads Probably a dumb question but just can't seem to make a decision here. 

I'm building a C# class library that I intend for other developers to use. Let's say one of these classes contains a method that accesses a remote resource and maps it to an object:

public class FooClient
{
    public async Task&lt;Foo&gt; ShowAsync(string name, ...)
    {
        return await DoStuffAsync(name);
    }
}


Where name identifies this remote resource. Let's also say that this resource can be identified by a numerical id, and that I can pass id.ToString() as name to this method and retrieve the same resource. So, I want an overload:

public class FooClient
{
    public async Task&lt;Foo&gt; ShowAsync(string name, ...)
    {
        return await DoStuffAsync(name);
    }
    public Task&lt;Foo&gt; ShowAsync(long id, ...)
    {
        return ShowAsync(id.ToString(), ...);
    }
} 


According to the Microsoft docs, I should avoid arbitrarily varying parameter names, so I'm tempted to do something like this:

public class FooClient
{
    public async Task&lt;Foo&gt; ShowAsync(string foo, ...)
    {
        return await DoStuffAsync(foo);
    }
    public Task&lt;Foo&gt; ShowAsync(long foo, ...)
    {
        return ShowAsync(foo.ToString(), ...);
    }
} 


But I'm afraid that, in this case, it would be more descriptive to have different names for the parameters, even though they identify the same resource. What should I do?
To answer your direct question - always name your parameters to match the intent of the type. If they are passing in an Id, call it an Id. What Microsoft is saying is if you had the following:

    public async Task&lt;Foo&gt; ShowAsync(string name, ...)
    {
        return await DoStuffAsync(foo);
    }
    public Task&lt;Foo&gt; ShowAsync(string resourceName, int id, ...)
    {
        return ShowAsync(resourceName + foo.ToString(), ...);
    }


In that case, name and resourceName represent the exact same concept: they are both the name of the resource. If you are using the same type and concept within overloads, always keep the name the same. For this, you are changing the type and concepts so change the name to match the concept.

With that said...

In this particular instance, I personally probably wouldn't use overloading and would, instead, say ShowBynameAsync and ShowByIdAsync. 

Downside - there's two distinct methods.

A potential upside is that no matter how the developer uses your API, it's always clear (to future readers) what they are passing in. Also, it's extremely clear what's being requested. You could still delegate the "showing" to ShowByNameAsync.

It's not "wrong" to use overloading here and not "right" to use descriptive method names. Just a preference.