ConsoleMVC.Framework
1.0.3
See the version list below for details.
dotnet add package ConsoleMVC.Framework --version 1.0.3
NuGet\Install-Package ConsoleMVC.Framework -Version 1.0.3
<PackageReference Include="ConsoleMVC.Framework" Version="1.0.3" />
<PackageVersion Include="ConsoleMVC.Framework" Version="1.0.3" />
<PackageReference Include="ConsoleMVC.Framework" />
paket add ConsoleMVC.Framework --version 1.0.3
#r "nuget: ConsoleMVC.Framework, 1.0.3"
#:package ConsoleMVC.Framework@1.0.3
#addin nuget:?package=ConsoleMVC.Framework&version=1.0.3
#tool nuget:?package=ConsoleMVC.Framework&version=1.0.3
ConsoleMVC
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.
Quick Start
# Install the template
dotnet new install ConsoleMVC.Template
# Create a new project
dotnet new consolemvc -n MyApp
cd MyApp
dotnet run
How It Works
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; } = "";
}
Features
- Convention-based routing — Controllers and Views are auto-discovered via reflection and namespace conventions
- Razor-like view engine —
.cvwfiles are compiled intoConsoleView<TModel>classes at build time by a source generator - No boilerplate — Views are plain C# code with an
@modeldirective, no class inheritance required - Familiar API —
View(),RedirectToAction(),ViewData— all the patterns you know from ASP.NET Core MVC - Navigation — Views return
NavigationResultto control app flow (NavigationResult.To(),NavigationResult.Quit())
Documentation
For full documentation and source code, visit the GitHub repository.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.