ZeraSystems.CodeNanite.Cshtml 2.0.3

There is a newer version of this package available.
See the version list below for details.
dotnet add package ZeraSystems.CodeNanite.Cshtml --version 2.0.3
                    
NuGet\Install-Package ZeraSystems.CodeNanite.Cshtml -Version 2.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="ZeraSystems.CodeNanite.Cshtml" Version="2.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ZeraSystems.CodeNanite.Cshtml" Version="2.0.3" />
                    
Directory.Packages.props
<PackageReference Include="ZeraSystems.CodeNanite.Cshtml" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add ZeraSystems.CodeNanite.Cshtml --version 2.0.3
                    
#r "nuget: ZeraSystems.CodeNanite.Cshtml, 2.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package ZeraSystems.CodeNanite.Cshtml@2.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=ZeraSystems.CodeNanite.Cshtml&version=2.0.3
                    
Install as a Cake Addin
#tool nuget:?package=ZeraSystems.CodeNanite.Cshtml&version=2.0.3
                    
Install as a Cake Tool

ZeraSystems.CodeNanite.Cshtml

CSHTML and Razor view generation code nanites for the CodeStencil template engine.

Overview

This package provides specialized code nanites for generating ASP.NET MVC and Razor Pages views (CSHTML files). It extends the core CodeNanite.Expansion functionality with powerful view generation capabilities for creating complete CRUD interfaces.

Features

CSHTML View Generation

  • CshtmlController: Generate ASP.NET MVC controller actions
  • CshtmlIndex: Create index/list views with tables
  • CshtmlDetails: Generate details/display views
  • CshtmlCreate: Create form views for entity creation
  • CshtmlEdit: Generate edit forms for entities
  • CshtmlFormGroup: Build Bootstrap form groups

HTML Component Generation

  • CshtmlTableHead: Generate table headers
  • CshtmlTableBody: Create table body rows with data binding
  • GetInputComponent: Determine appropriate input controls based on data types
  • CshtmlHtmlDisplay: Generate display templates
  • CshtmlFormGroup: Create responsive form layouts

Advanced Features

  • CshtmlIncludeThenInclude: Generate Entity Framework Include/ThenInclude statements
  • MegaMenu: Create hierarchical navigation menus

Target Frameworks

  • .NET Framework 4.8
  • .NET 10.0 (Windows)

Installation

Package Manager Console

Install-Package ZeraSystems.CodeNanite.Cshtml -Version 2.0.0

.NET CLI

dotnet add package ZeraSystems.CodeNanite.Cshtml --version 2.0.0

PackageReference

<PackageReference Include="ZeraSystems.CodeNanite.Cshtml" Version="2.0.0" />

Usage

This package is designed to be used within CodeStencil templates for generating ASP.NET MVC/Razor views.

Example: Generate Index View

In your CodeStencil template:

<%@ template language="C#" %>
<%@ import namespace="ZeraSystems.CodeNanite.Cshtml" %>

@model IEnumerable<<%= CurrentTable() %>>

<h1><%= CurrentTableLabel() %></h1>

<table class="table">
    <thead>
        <%= CshtmlTableHead() %>
    </thead>
    <tbody>
        <%= CshtmlTableBody() %>
    </tbody>
</table>

Example: Generate Create Form

@model <%= CurrentTable() %>

<h2>Create <%= CurrentTableLabel() %></h2>

<form asp-action="Create">
    <%= CshtmlFormGroup() %>
    
    <button type="submit" class="btn btn-primary">Create</button>
</form>

Example: Generate Controller

public class <%= CurrentTable() %>Controller : Controller
{
    <%= CshtmlController() %>
}

Generated Components

Views

  • Index Views: List/grid views with sorting and filtering
  • Details Views: Read-only display views
  • Create Views: Forms for creating new entities
  • Edit Views: Forms for editing existing entities
  • Delete Views: Confirmation views for deletion

Form Elements

  • Text inputs for string fields
  • Number inputs for numeric fields
  • Date pickers for DateTime fields
  • Checkboxes for boolean fields
  • Select dropdowns for foreign keys
  • Textarea for long text fields

Bootstrap Integration

All generated views are Bootstrap-ready with:

  • Responsive grid layouts
  • Form validation styling
  • Button styling
  • Table styling
  • Alert messages

Dependencies

  • ZeraSystems.CodeStencil.Contracts (v2.0.0+)
  • ZeraSystems.CodeNanite.Expansion (v2.0.0+)
  • System.ComponentModel.Composition (v4.6.0+ for .NET Framework, v10.0.0+ for .NET 10)

Code Nanite Categories

Controller Generation

  • CRUD action methods
  • Async/await support
  • Entity Framework integration
  • ViewBag/ViewData setup

View Generation

  • Strongly-typed views
  • Form helpers
  • HTML helpers
  • Validation helpers

HTML Components

  • Tables with sorting
  • Forms with validation
  • Navigation menus
  • Display templates

Documentation

For complete documentation and examples:

Version History

2.0.0

  • Upgraded to .NET 10.0 support
  • Maintained .NET Framework 4.8 compatibility
  • Updated to CodeStencil.Contracts 2.0.0
  • Updated System.ComponentModel.Composition to v10.0.0 for .NET 10
  • Converted to SDK-style project format
  • Added support for modern Razor syntax

1.5.x

  • Previous stable release for .NET Framework 4.8

License

This package is licensed under the MIT License.

Support

For support and questions:

Contact

For any questions or feedback, please contact us at support@codestencil.com

Copyright � 2018-2025 ZERA Systems Inc.

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.4 199 12/19/2025
2.0.3 432 12/10/2025
2.0.2 565 12/1/2025
2.0.0 280 11/12/2025
1.5.4 255 4/21/2025
1.5.3 174 2/16/2025
1.5.2 185 2/15/2025
1.5.1 210 10/15/2024
1.5.0 199 6/4/2024
1.4.9 401 5/22/2024
1.4.8 1,527 1/20/2024
1.4.4 938 12/21/2023
1.4.3 2,062 10/3/2023
1.4.0 275 7/25/2023
1.3.3.9 253 7/11/2023
1.3.3.8 269 5/2/2023
1.3.3.4 1,166 8/6/2021
1.3.2 1,827 7/14/2020
1.3.0 716 6/30/2020

Updated project and NuGet package versions to 2.0.3.
     Changed copyright year to 2026 and standardized author name in nuspec.
     Added detailed release notes to .csproj.
     Updated CodeStencil.Contracts reference to 2.0.3.
     Commented out .NETFramework4.8 dependency group in nuspec.
     Improved MSBuild signing command formatting.