Skip to content
/ R4MVC Public
forked from T4MVC/R4MVC

R4MVC is a Roslyn code generator for ASP.NET Core MVC apps that creates strongly typed helpers that eliminate the use of literal strings in many places

License

Notifications You must be signed in to change notification settings

valeriob/R4MVC

 
 

Repository files navigation

R4MVC

Build status R4Mvc on NuGet
CI build: R4Mvc on MyGet

R4MVC is a Roslyn code generator for ASP.NET MVC Core apps that creates strongly typed helpers that eliminate the use of literal strings in many places.

It is a re-implementation of T4MVC for ASP.NET Core projects.

Benefits

Instead of

@Html.ActionLink("Dinner Details", "Details", "Dinners", new { id = Model.DinnerID }, null)

R4MVC lets you write

@Html.ActionLink("Dinner Details", MVC.Dinners.Details(Model.DinnerID))

When you're using tag helpers, instead of

<a asp-action="Details" asp-controller="Dinners" asp-route-id="@Model.DinnerID">Dinner Details</a>

you can write

<a mvc-action="MVC.Dinners.Details(Model.DinnerID)">Dinner Details</a>

and that's just the beginning!

Usage

R4MVC runs in Visual Studio 2017, and supports ASP.NET Core MVC 1 (v2 support in progress)

To use it, simply install the R4Mvc and R4Mvc.Tools package using NuGet. It will add the necessary tooling to your project, which will be invoked on install. You will instantly see a number of files get created in your project.

Unlike T4MVC, R4MVC isn't based on a T4 template, so triggering the generation code is slightly different. Currently, you would need to open the Package Manager Console (Tools Menu -> NuGet Package Manager -> Package Manager Console) and running the following PowerShell command:

> Generate-R4MVC

Use the following links to get started

About

R4MVC is a Roslyn code generator for ASP.NET Core MVC apps that creates strongly typed helpers that eliminate the use of literal strings in many places

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C# 90.4%
  • PowerShell 9.3%
  • Other 0.3%