SG4MVC is a source 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 R4MVC using source generators.
R4MVC runs as you build, and currently has only been tested on net6.0
Just want to get started? Visit the Get Started page for installation and configuration instructions.
Instead of
@Html.ActionLink("Dinner Details", "Details", "Dinners", new { id = Model.DinnerID }, null)SG4MVC 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 (after registering Sg4Mvc tag helpers in _ViewImports.cshtml with the directive: @addTagHelper *, Sg4Mvc)
<a mvc-action="MVC.Dinners.Details(Model.DinnerID)">Dinner Details</a>and that's just the beginning!
- Install SG4MVC is distributed using using NuGet. Visit the Get Started page
- Discuss: Discuss it on GitHub
- Contribute
- History & release notes: change history