Apstory.Scaffold.App 1.1.0.106

Prefix Reserved
dotnet tool install --global Apstory.Scaffold.App --version 1.1.0.106
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local Apstory.Scaffold.App --version 1.1.0.106
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=Apstory.Scaffold.App&version=1.1.0.106
                    
nuke :add-package Apstory.Scaffold.App --version 1.1.0.106
                    

Apstory.Scaffold.App

Overview

Apstory.Scaffold.App follows an MSSQL database-first approach to generate CRUD stored procedures and related C# code.
It adopts a convention-over-configuration methodology, reducing complexity when running the application.

Generated SQL Procedures

When running regen on a table, the following SQL procedures will be generated:

  • DelHrd – Hard delete from the table.
  • DelSft – Soft delete (marks row as IsActive = false).
  • GetByTableNameIds – Fetches rows based on a list of supplied IDs.
  • GetById – Fetches a record based on the primary key.
  • GetByIds – Fetches records based on foreign keys.
  • GetByIdsPaging – Fetches a paginated set of rows.
  • InsUpd – Inserts or updates an entry in the table.

Generated C# Structure

Dependency Injection (DI) Registration

  • Common/ProjectName.Common.ServiceCollectionExtension/Gen/AddGeneratedRepositoriesServiceCollectionExtension.cs
    • Registers repositories with SQL connection strings.
  • Common/ProjectName.Common.ServiceCollectionExtension/Gen/AddGeneratedServicesServiceCollectionExtension.cs
    • Registers services.

Data Access Layer (DAL)

  • Dal/ProjectName.Dal.Dapper/Gen/TableNameRepository.Gen.cs
    • Contains Dapper methods to interact with the SQL database.
  • Dal/ProjectName.Dal.Interface/Gen/ITableNameRepository.Gen.cs
    • Repository interface.

Domain Layer

  • Domain/ProjectName.Domain/Gen/TableNameService.Gen.cs
    • Service layer that interacts with the repository.
  • Domain/ProjectName.Domain/Gen/TableNameService.Foreign.Gen.cs
    • Extends the service layer with additional methods for handling foreign key relationships (depth of 1).
  • Domain/ProjectName.Domain.Interface/Gen/ITableNameService.Gen.cs
    • Interface for the service layer.
  • Domain/ProjectName.Domain.Interface/Gen/ITableNameService.Foreign.Gen.cs
    • Interface for the foreign key service layer.

Model Layer

  • Model/ProjectName.Model/Gen/TableName.Gen.cs
    • Represents the database table as a model, including foreign key relationships.

Installation

To install or update the tool globally use the following command:

dotnet tool update Apstory.Scaffold.App --global

Usage

Running Apstory.Scaffold.App will search for a .sqlproj file, extract the namespace for the entire project, and begin watching for any .sql file changes.
By default, running the application without parameters will make it run in the background, continuously watching for file changes.
The .sqlproj file used can be overridden using the -sqlproject parameter.

Available Command-Line Switches

  • -sqlproject <path>
    Overrides the SQL project path instead of letting the application search for it.

  • -namespace <name>
    Overrides the namespace for scaffolded code instead of fetching it from the .sqlproj.

  • -regen <params>
    Executes immediate regeneration of files.

    • When no parameters are supplied, it regenerates all found schemas.
    • You can specify:
      • A schema: dbo
      • A table: dbo.tablename
      • A procedure: dbo.zgen_procname
    • Multiple entities can be specified using ;, e.g.:
      -regen dbo;dbo.Customer;dbo.zgen_GetOrders
      
  • -sqlpush <params>
    Pushes changes to the database.

    • When left empty, it detects Git changes.
    • You can specify:
      • A table: dbo.tablename (Limited functionality - Will only push new tables, not any updates made to an existing table)
      • A procedure: dbo.zgen_procname
    • Requires the -sqldestination switch.
      • Specifies the database connection string for pushing changes.
    • Note: Only initial table creation can be pushed, no table updates are pushed.
    • Multiple entities can be specified using ;, e.g.:
      -sqlpush dbo.Customer;dbo.zgen_InsertOrder
      
  • -delete
    Deletes and removes associated scaffolded code.

    • When left empty, it deletes all scaffolded code.
    • You can specify:
      • A schema: dbo To delete all scaffolded code within a schema.
      • A table: dbo.tablename to delete the table and all scaffolded sql stored procedures
      • A procedure: dbo.zgen_procname
  • -tsdalfolder Scaffolds a SQLite repository based on a typescript model

    • Requires the -tsmodel switch to point to a specific typescript model.
Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 was computed.  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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last Updated
1.1.0.106 0 12/5/2025
1.1.0.105 36 12/3/2025
1.1.0.104 323 11/17/2025
1.1.0.103 269 11/11/2025
1.1.0.102 169 10/23/2025
1.1.0.101 169 10/22/2025
1.1.0.100 162 10/22/2025
1.1.0.99 167 10/14/2025
1.1.0.98 164 10/13/2025
1.1.0.97 169 10/7/2025
1.1.0.96 159 9/28/2025
1.1.0.95 174 9/24/2025
1.1.0.94 262 9/24/2025
1.1.0.93 159 9/5/2025
1.1.0.92 246 8/7/2025
1.1.0.91 237 8/6/2025
1.1.0.90 216 8/4/2025
1.1.0.89 74 8/2/2025
1.1.0.88 136 7/30/2025
1.1.0.87 538 7/22/2025
1.1.0.86 163 7/15/2025
1.1.0.85 161 7/15/2025
1.1.0.84 157 7/15/2025
1.1.0.83 171 7/10/2025
1.1.0.82 166 6/26/2025
1.1.0.81 167 6/16/2025
1.1.0.80 328 6/11/2025
1.1.0.79 311 6/11/2025
1.1.0.78 302 6/10/2025
1.1.0.77 301 6/10/2025
1.1.0.76 308 6/10/2025
1.1.0.75 321 6/10/2025
1.1.0.74 315 6/10/2025
1.1.0.73 298 6/9/2025
1.1.0.72 271 6/9/2025
1.1.0.71 250 6/9/2025
1.1.0.70 131 6/6/2025
1.1.0.69 156 6/5/2025
1.1.0.68 159 6/5/2025
1.1.0.67 164 6/5/2025
1.1.0.66 162 6/5/2025
1.1.0.65 168 6/4/2025
1.1.0.64 180 6/4/2025
1.1.0.63 177 6/1/2025
1.1.0.62 168 5/27/2025
1.1.0.61 176 5/20/2025
1.1.0.60 257 5/14/2025
1.1.0.59 170 5/5/2025
1.1.0.58 179 5/5/2025
1.1.0.57 230 4/24/2025
1.1.0.56 210 4/7/2025
1.1.0.55 203 4/7/2025
1.1.0.54 513 3/25/2025
1.1.0.53 176 3/18/2025
1.1.0.52 172 3/18/2025
1.1.0.51 177 3/18/2025
1.1.0.50 171 3/17/2025
1.1.0.49 182 3/17/2025
1.1.0.48 158 3/13/2025
1.1.0.47 180 3/13/2025
1.1.0.46 231 3/10/2025