Scaffolding controller in Rider
Asked Answered
L

1

2

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:

enter image description here

Larocca answered 5/9, 2017 at 20:32 Comment(0)
D
4

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:

  1. Right click in the Controller folder.
  2. 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

Doble answered 6/9, 2017 at 1:6 Comment(2)
Actually, nothing fancy here... cuz a controller is just a class that inherits the Controller class.Larocca
Hi, @0xRumple. I agree with you, nothing fancy. That's all Rider can offer right now.Doble

© 2022 - 2024 — McMap. All rights reserved.