Forum Discussion
Introducing PASS — Project Aware Smart Scaffolder for ASP.NET Core MVC
Hello .NET Community!
I would like to introduce an independent software architecture and research initiative that I have been developing: PASS (Project Aware Smart Scaffolder).
The central idea behind this initiative is to explore an important challenge in database-first ASP.NET Core MVC development:
How can developers regenerate scaffolded code after database or project changes without losing their existing customizations and business logic?
1. The problem: The scaffolding paradox
Microsoft's existing scaffolding capabilities provide an excellent starting point for generating application code.
However, in an iterative development environment, developers frequently customize generated models, controllers, views and other application components.
When the underlying database schema changes, regenerating these components can introduce conflicts with existing custom implementations.
Developers may consequently need to:
- Manually reconcile generated and customized code.
- Reapply previously implemented business logic.
- Maintain additional conventions and project-specific configurations.
- Avoid regeneration because of the potential impact on existing work.
This creates an interesting architectural challenge:
How can scaffolding remain useful throughout the entire application lifecycle rather than primarily during initial code generation?
2. The proposed approach: PASS
PASS explores a deterministic, database-aware, project-aware and non-destructive scaffolding architecture intended to complement Microsoft's existing scaffolding capabilities rather than replace them.
Its proposed architectural concepts include:
Persistent project configuration — dass.json
A centralized configuration file intended to preserve project-specific conventions, generation preferences and architectural decisions.
Roslyn-based syntax-tree analysis and merging
Exploring C# Abstract Syntax Trees (ASTs) to identify structural changes and reconcile generated code while preserving compatible custom implementations.
Project awareness
Considering existing project structure, naming conventions, architectural decisions and dependencies when generating or updating code.
Database awareness
Using database schema changes as inputs for identifying required code-generation updates.
Non-destructive regeneration
The overall objective is to reduce unnecessary overwriting of developer-maintained code during subsequent scaffolding operations.
3. Current research status
PASS is currently in its Research & RFC (Request for Comments) phase.
The repository contains architectural and research documentation, including:
- Research Proposal
- Methodology & Evaluation Plan
- System Architecture
- Roslyn Merging Strategy
- RFC-0001: Community Discussion
The project is not being presented as a completed or production-ready implementation. The current priority is to validate the architectural assumptions, identify technical limitations and obtain feedback before proceeding with implementation.
Project repository and research documentation:
https://github.com/RashedulHaqueRonjon/PASS-Framework/
4. Topics where I would particularly appreciate community feedback
I would welcome perspectives from experienced C#, ASP.NET Core MVC, Entity Framework Core and Roslyn developers on the following architectural questions:
What would be the most reliable strategy for distinguishing generated code from developer-maintained custom code?
Which Roslyn syntax-tree analysis and merging approaches would be appropriate for safely reconciling existing C# files?
How should the architecture handle conflicting changes between database-generated properties and manually maintained model implementations?
What safeguards should be considered before automatically applying changes to existing project files?
Would a persistent project configuration file such as pass.json be an effective way to preserve project-specific scaffolding conventions?
What testing and evaluation criteria would you recommend before considering such a framework technically reliable?
5. An invitation to the .NET community
I believe that improving the sustainability of code generation is a worthwhile area of exploration for the ASP.NET Core ecosystem.
I would particularly appreciate constructive architectural criticism, alternative approaches, technical recommendations and suggestions for improving the research methodology.
This is an independent research initiative, and the objective at this stage is to learn from the experience of the .NET community.
Thank you for your time and consideration.
Rashedul Haque Ronjon
Independent Researcher
2 Replies
- suhaneesatter2000Tin Contributor
PASS is an interesting research initiative addressing a real limitation of database-first ASP.NET Core MVC development.
Its strongest idea is non-destructive scaffolding using Roslyn AST analysis, allowing developers to regenerate code while preserving custom business logic.
My key recommendation: prioritize reliable change detection, conflict resolution, automatic backups, and rollback before implementing automatic code merging.
The concept is promising and deserves constructive feedback from the .NET community.
- markeviusfullenwider2000Copper Contributor
PASS addresses a genuine weakness in database-first scaffolding: preserving developer customizations during code regeneration.
The most important technical challenge will be reliably distinguishing generated code from manually maintained logic.
My recommendations:
- Use Roslyn syntax trees for structural analysis and controlled merging.
- Keep generated and custom code separate wherever possible (partial classes, separate services).
- Maintain a generation manifest to track generated files and changes.
- Detect conflicts and request developer approval rather than silently overwriting code.
- Include automated regression tests for schema changes and repeated regeneration.
My biggest suggestion: Make non-destructive regeneration and conflict detection the foundation of PASS. Reliability and developer trust will matter more than the number of features.