假设我有一个新界面:
public interface IClientRepository
{
void Add(Customer customer);
void Remove(Customer customer);
Customer Get(long id);
}
现在我想做以下事情:
ClientRepository
”); 我想我已经看到 Pluralsight 视频的讲师在很多场合都这样做了,但我似乎找不到为此使用的键盘快捷键。
我尝试了什么?好:
我在这里想念什么?如何从接口(interface)生成类?
最佳答案
public interface |IClientRepository
点击 Alt+Enter,然后选择创建派生类型。这将创建一个名为 ClientRepository
的类。在与 IClientRepository
相同的文件中.ClientRepository
的类类型名称上,然后按 Ctrl+R、Ctrl+O 并选择移动到另一个文件。它将默认为与类型名称匹配的文件名,并将其放在与从中移动的文件相同的目录中。关于visual-studio - 从接口(interface)生成类,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25565851/