![]() |
VOOZH | about |
dotnet add package ConsoleMVC.Framework --version 1.1.0
NuGet\Install-Package ConsoleMVC.Framework -Version 1.1.0
<PackageReference Include="ConsoleMVC.Framework" Version="1.1.0" />
<PackageVersion Include="ConsoleMVC.Framework" Version="1.1.0" />Directory.Packages.props
<PackageReference Include="ConsoleMVC.Framework" />Project file
paket add ConsoleMVC.Framework --version 1.1.0
#r "nuget: ConsoleMVC.Framework, 1.1.0"
#:package ConsoleMVC.Framework@1.1.0
#addin nuget:?package=ConsoleMVC.Framework&version=1.1.0Install as a Cake Addin
#tool nuget:?package=ConsoleMVC.Framework&version=1.1.0Install as a Cake Tool
An MVC framework for console applications, inspired by ASP.NET Core MVC.
ConsoleMVC brings the familiar Controller-ViewModel pattern to console apps — with convention-based routing, reflection-based auto-discovery, and Razor-like .cvw view templates powered by a C# source generator.
# Install the template
dotnet new install ConsoleMVC.Template
# Create a new project
dotnet new consolemvc -n MyApp
cd MyApp
dotnet run
Program.cs — familiar ASP.NET-style builder:
var builder = MvcApplication.CreateBuilder(args);
var app = builder.Build();
app.Run();
Controllers — inherit from Controller, return ActionResult:
public class HomeController : Controller
{
public ActionResult Index()
{
var model = new HomeViewModel { Title = "Hello!" };
return View(model);
}
}
Views — .cvw files with @model directive, no class boilerplate:
@model MyApp.Models.HomeViewModel
Console.WriteLine(Model.Title);
Console.Write("Press any key...");
Console.ReadKey();
return NavigationResult.To("Home", "Index");
Models — simple DTOs:
public class HomeViewModel
{
public string Title { get; set; } = "";
}
.cvw files are compiled into ConsoleView<TModel> classes at build time by a source generator@model directive, no class inheritance requiredView(), RedirectToAction(), ViewData — all the patterns you know from ASP.NET Core MVCNavigationResult to control app flow (NavigationResult.To(), NavigationResult.Quit())Console.ReadLine() and post it to controller actions using NavigationResult.To("Controller", "Action", formData). The framework automatically binds the data to action method parameters — either as individual simple types (int, string, etc.) or as a complex model class with matching property namesFor .cvw file recognition, syntax highlighting, and icon support in JetBrains Rider, install the ConsoleMVC CVWSupport plugin:
For full documentation and source code, visit the GitHub repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 net10.0 is compatible. net10.0-android net10.0-android was computed. net10.0-browser net10.0-browser was computed. net10.0-ios net10.0-ios was computed. net10.0-maccatalyst net10.0-maccatalyst was computed. net10.0-macos net10.0-macos was computed. net10.0-tvos net10.0-tvos was computed. net10.0-windows net10.0-windows was computed. |
This package is not used by any NuGet packages.
This package is not used by any popular GitHub repositories.