ZeraSystems.CodeNanite.Schema 2.0.0

There is a newer version of this package available.
See the version list below for details.
dotnet add package ZeraSystems.CodeNanite.Schema --version 2.0.0
                    
NuGet\Install-Package ZeraSystems.CodeNanite.Schema -Version 2.0.0
                    
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.Schema" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="ZeraSystems.CodeNanite.Schema" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="ZeraSystems.CodeNanite.Schema" />
                    
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.Schema --version 2.0.0
                    
#r "nuget: ZeraSystems.CodeNanite.Schema, 2.0.0"
                    
#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.Schema@2.0.0
                    
#: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.Schema&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=ZeraSystems.CodeNanite.Schema&version=2.0.0
                    
Install as a Cake Tool

ZeraSystems.CodeNanite.Schema

Schema and database-related code nanites for the CodeStencil template engine.

Overview

This package provides specialized code nanites for working with database schemas, tables, columns, views, and DTOs. It extends the core CodeNanite.Expansion functionality with powerful database-specific code generation capabilities.

Features

Column Operations

  • ExpandColumnsHorizontally: Expand table columns horizontally in templates
  • ExpandModels: Generate model classes from database schemas
  • GetColumnCaptions: Retrieve user-friendly column captions
  • GetColumnDbTypes: Extract database-specific column types
  • GetColumnInputComponent: Generate appropriate input components for columns
  • GetColumnNames: Access column names and metadata
  • GetColumnTypes: Retrieve .NET types for database columns
  • GetPrimaryKey: Identify and work with primary key columns
  • ModelColumns: Generate column definitions for models

Table Operations

  • CurrentTable: Access current table context in templates
  • TableList: Iterate through multiple tables
  • GenerateDbSet: Create Entity Framework DbSet properties
  • GenerateFluentConfig: Generate Fluent API configurations
  • GenerateModel: Create model classes from tables
  • GenerateLookups: Generate lookup tables and enums
  • DatabaseContext: Generate DbContext classes

View Operations

  • CurrentView: Work with database views
  • ViewList: Iterate through database views
  • View-specific naming conventions (Camel case, lowercase, pluralization)

DTO Operations

  • GetDtoColumnNames: Extract DTO property names
  • GetDtoColumnCaptions: Generate DTO display names
  • MappingDto: Create DTO mapping configurations
  • DeclareList: Generate DTO list declarations

Target Frameworks

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

Installation

Package Manager Console

Install-Package ZeraSystems.CodeNanite.Schema -Version 2.0.0

.NET CLI

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

PackageReference

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

Usage

This package is designed to be used within CodeStencil templates for database-driven code generation.

Example: Generate Model from Table

In your CodeStencil template:

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

// Use Schema code nanites
public class <%= CurrentTable() %>
{
    <%= GenerateModel() %>
}

Example: Generate DbContext

public class ApplicationDbContext : DbContext
{
    <%= GenerateDbSet() %>
    
    protected override void OnModelCreating(ModelBuilder modelBuilder)
    {
        <%= GenerateFluentConfig() %>
    }
}

Dependencies

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

Code Nanite Categories

Columns

  • Column name and type extraction
  • Column metadata and attributes
  • Primary key and foreign key handling
  • Input component generation

Tables

  • Table iteration and selection
  • DbSet generation
  • Model class generation
  • Entity Framework configuration

Views

  • Database view processing
  • View-based model generation
  • Naming convention transformations

DTOs

  • DTO class generation
  • Property mapping
  • Display name generation
  • AutoMapper configuration

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

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:

Copyright � 2018-2025 ZERA Systems Inc.

Product Compatible and additional computed target framework versions.
.NET net10.0-windows7.0 is compatible. 
.NET Framework net48 is compatible.  net481 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.7 0 3/13/2026
2.0.6 111 1/28/2026
2.0.5 261 12/19/2025
2.0.4 458 12/10/2025
2.0.3 455 12/10/2025
2.0.2 588 12/1/2025
2.0.1 149 11/28/2025
2.0.0 311 11/12/2025
1.7.0 290 11/10/2025
1.6.9 162 10/31/2025
1.6.8 221 10/29/2025
1.6.7 138 10/25/2025
1.6.6 228 9/24/2025
1.6.5 217 9/21/2025
1.6.4 191 7/31/2025
1.6.0 306 7/20/2025
1.5.9 219 7/16/2025
1.5.8 179 7/12/2025
1.5.6 272 4/21/2025
1.5.5 211 2/16/2025
Loading failed