Visual Studio中Go To Definition
和Go To Implementation
之间有什么区别?
版本: Visual Studio 2015 Update 1
答案 0 :(得分:10)
假设我们有这个界面:
public interface IEmailSender
{
Task SendEmailAsync(string email, string subject, string message);
}
实现此接口的类:
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);
}
}
如果我们右键单击IEmailSender
并选择Go To Implementation,Visual Studio会将我们导航到实现此接口的类,即AuthMessageSender
。
如果我们在IEmailSender
课程中右键单击AuthMessageSender
并选择转到定义,Visual Studio会将我们导航到IEmailSender
的定义。< / p>