Suppose I have a new interface:
public interface IClientRepository
{
void Add(Customer customer);
void Remove(Customer customer);
Customer Get(long id);
}
Now I'd like to do the following:
ClientRepository
");I think I've seen instructors of Pluralsight videos do this on numerous occasions, but I can't seem to find out what keyboard shortcuts to use for this.
What have I tried? Well:
What am I missing here? How do you generate a class from an interface?
Put the cursor on the interface type name, for instance here:
public interface |IClientRepository
Hit Alt+Enter, and select Create Derived Type. This creates a class called ClientRepository
in the same file as IClientRepository
.
Now put your cursor on the class type name of ClientRepository
, and hit Ctrl+R, Ctrl+O and select Move to another file. It will default to a file name that matches the type name and puts it in the same directory as the file it was moved from.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With