0

I use visual studio 2019
I have a class

public class User
{
    /// <summary>
    /// Create user in DB
    /// </summary>
    /// <param name="user"></param>
    public void AddUser(User user)
    {
        // Create User
    }
}

I want to extract an interface for this class, but I want the comments of the methods in the interface too.

Milad Ahmadi
  • 267
  • 4
  • 8
  • Very first hit on [Google](https://learn.microsoft.com/en-us/visualstudio/ide/reference/extract-interface?view=vs-2019); for the comments, you can use `` – Mark Benningfield Aug 20 '21 at 15:50
  • Does this answer your question? [Ways to synchronize interface and implementation comments in C#](https://stackoverflow.com/questions/824007/) and [Inheriting XML comments from interfaces in C#](https://stackoverflow.com/questions/3773037/) and [Comment Inheritance for C# (actually any language)](https://stackoverflow.com/questions/342964/) –  Aug 20 '21 at 16:26
  • Try these, not sure about comments, Keyboard Press Ctrl+R, then Ctrl+I. (Your keyboard shortcut may be different based on which profile you've selected.) Press Ctrl+. to trigger the Quick Actions and Refactorings menu and select Extract Interface from the Preview window popup. Mouse Select Edit > Refactor > Extract Interface. Right-click the name of the class, select the Quick Actions and Refactorings menu and select Extract Interface from the Preview window popup. – H.S Aug 20 '21 at 16:41

0 Answers0