microsoft / vscode-dotnettools

This is a feedback repository to capture issues logged for the C# Dev Kit and related extensions from Visual Studio Code
Other
192 stars 6 forks source link

[SUGGESTION] New Razor Component with Partial Class #1047

Open scottkuhl opened 1 month ago

scottkuhl commented 1 month ago

Describe the feature you'd like

An option to create new Razor Components with a partial class code behind.

webreidi commented 4 weeks ago

@scottkuhl have you tried using the New File icon in Solution Explorer to add your Razor Component? Is this the functionality you would like added to the File>New File option? Or is there something else missing?

image

scottkuhl commented 4 weeks ago

@webreidi the part that is missing is an option to create the Razor Component with a partial class code behind file instead of just the Razor Component with a code region. Right now if you are using partial classes you need to create two new files, update the razor file to remove the code region, and update the code behind class to make it partial.

Partial class support