问题
I'm trying to move from VS 2017 into Rider... the IDE is very appealing!
WITHOUT using the command line, is there a way to scaffold a controller in the fashionable way of adding a controller from the context menu, as in here:
回答1:
No, you do not have the options to scaffold a controller from a class or viewmodel as in VisualStudio, but you still can create a controller with a right click.
Althought it is not as fashionable as VisualStudio, you can add a Controller in a very similar way:
- Right click in the Controller folder.
- In the context menu select New->Controller.
Rider will create a simple Controller structure for you like this:
using System.Web.Mvc;
namespace ASPNETMVCApplication.Areas.Admin.Controllers
{
public class Controller1 : Controller
{
// GET
public ActionResult Index()
{
return
View();
}
}
}
Then you can Alt+Enter over the View() and create a view.
But it is still far away from the options VisualStudio offers in this situation.
Rider version: Rider 2017.1.1 Build #RD-171.4456.2813, built on August 22, 2017
来源:https://stackoverflow.com/questions/46062951/scaffolding-controller-in-rider