19

Visual Studio でのGo To Definitionとの違いは何ですか?Go To Implementation

バージョン: Visual Studio 2015 Update 1

4

1 に答える 1

19

Let's say we have this interface:

public interface IEmailSender
{
    Task SendEmailAsync(string email, string subject, string message);
}

And a class that implements this interface:

public class AuthMessageSender : IEmailSender
{
    public Task SendEmailAsync(string email, string subject, string message)
    {
        // Plug in your email service here to send an email.
        return Task.FromResult(0);
    }
}

If we right click on IEmailSender and choose Go To Implementation, Visual Studio navigates us to the class that implements this interface, namely AuthMessageSender.
If we right click on IEmailSender while we are in AuthMessageSender class and
choose Go To Definition, Visual Studio navigates us to the definition of the IEmailSender.

于 2015-12-23T12:41:17.833 に答える