Introduction
MetaFirst is a web-based code generator for ASP.NET Core, designed to accelerate development by generating ready-to-run source code based on metadata. It supports EF Core-compatible databases and runs on Windows, Linux, and macOS environments.
In addition to producing a complete Visual Studio solution, MetaFirst automatically generates entities, services, repositories, WebAPI controllers, test projects, and a fully functional Admin application. The generated architecture follows clean, maintainable patterns and provides a solid foundation for further customization.
MetaFirst enables rapid prototyping and consistent application design, making it easy to evolve data models, regenerate code safely, and integrate new functionality through Templates. With support for EAV structures, media handling, relational navigation, and flexible deployment configurations, it helps teams deliver robust, scalable applications with significantly reduced manual effort.
By using Metadata as a single source of truth, MetaFirst ensures that all layers of the application remain synchronized and error-free—even as the project grows in complexity.
The MetaFirst Way
Many applications follow a domain-driven or data-driven approach, where the first step is to define the entities, their properties, and the relationships between them. These structures are typically stored in a relational database. MetaFirst fully supports and enhances this approach.
- Define your data model
Begin by specifying your entities, properties, and relationships. For example, a ToDoList application may define entities such as ToDoList and ToDoItem, with properties like ListName, ToDoName, StartDate, Resolved, and others.
- Generate the complete backend in minutes
MetaFirst automatically generates the database context, smart model classes, CRUD services, an Admin web application, a WebAPI, NUnit tests, and additional components such as event handlers and repository support.
- Extend functionality through MetaFirst Templates
Once the backend is generated, MetaFirst recommends extending features using Templates. Templates can contain simple instructions on how to adjust the code, or provide complete modules such as a CMS, webshop components, or metadata extensions that expand the database and logic.
- Develop the frontend using generated components
While MetaFirst does not generate the frontend itself, it provides reusable models, events, and examples through the Admin application. Frontend frameworks such as Vue, React, Angular, or even plain HTML/JavaScript can easily integrate with the generated WebAPI to access and manage the data.
Key Features
- Code generation for application framework, admin interface, Web API, and tests
- Generates POCO classes and EF Core DbContext
- Support for .cs and .cshtml output
- Metadata-based model input via CSV or extracted from an existing schema (existing database)
- Built-in metadata editor
- Cross-platform support (Windows, Linux, macOS)
Target Users
- Software Developers - Developers who want to quickly and efficiently create admin and viewer web applications without investing excessive time in manual coding.
- Database Administrators - Professionals who could use the tool to visually represent and manage complex database structures.
- IT Departments - Companies that require internal applications for managing data and processes could benefit from such a tool.
- Start-ups - Young companies looking to rapidly develop prototypes and MVPs (Minimum Viable Products) to test and present their ideas.
- Business Analysts - Analysts who need to visualize data and generate reports could use the tool to streamline their work.
- Educational Institutions - Universities and schools could integrate the tool into IT and computer science courses to give students hands-on experience in web- and database development.
- Consulting Firms - Consulting companies that create custom solutions for their clients could leverage the tool to work more efficiently.
Example Web Applications Primarily Based on a Database and CRUD
- Personnel Information Systems: Managing employee data, contact information, departments, and working hours.
- Library Management Systems: Managing book inventories, member information, checkouts, and returns.
- Order and Inventory Systems: Managing stock levels, orders, suppliers, and product categories.
- Customer Relationship Management (CRM) Systems: Managing customer data, interactions, sales opportunities, and support requests.
- Blog Platforms: Managing blog posts, categories, comments, and users.
- Project Management Tools: Managing projects, tasks, milestones, and team members.
- Appointment Booking Systems: Managing appointments, customer information, and availabilities.
- Survey Systems: Managing surveys, responses, and participants.
- Event Registration Systems: Managing events, participant registrations, and payments.
These applications often rely heavily on CRUD operations to manage data within a database and typically do not require more complex functionalities.
Why MetaFirst
- The generated CRUD functionality makes 80-100% of the backend code, and also a big amount of error free frontend code, depending of the application type.
- Allows completely customized applications, because it is very easy to make database changes, that are immediately (error free) applied
- You can fully concentrate on Frontend development (that can use the generated Framework, Model classes, CRUD services, Events and can use the Admin View Models, Views and Controllers as Templates for the Frontend)
- Allows flexible configurations for development and deployment
- direct database access through EF
- access through the WebAPI (that makes the database access)
- using a Repository for data access in memory
- Development of the Frontend can be done locally, while the Database, Admin, and WebApi are deployed on a Server
- Production deployment allows flexible configurations with Database, Admin, and Frontends on different Servers
- Ideal for data centric applications. It allows to have many intermediate Tables, because all are automatically generated.
- Allows simple and decoupled architecture. Since the code is generated error free within minutes, you can have extra services, controllers and views, instead of using conditions.
- Template-Components can be used and easily adjusted for similar applications
- The Metadata csv file is the only input resource, that can be easily saved and transmitted.
- You get a fast created Demo to show. In fact you can adjust the Metadata together with your customer, and immediately show the resulting Admin, even add data instantly.
- Advantages of code generation:
- Time Savings: Reduces the time required for repetitive tasks.
- Consistency: Ensures that generated code is consistent and adheres to standards.
- Error Reduction: Minimizes human errors through automation.
Glossary
| Term | Definition |
|---|---|
| Metadata | Information that defines Attributes about Properties, like MaxLength, Type, Name, Nullable of a Property. |
| POCO Class | "Plain Old CLR Object" — simple C# object without behavior or base classes. |
| DbContext | The EF Core class responsible for database access and mapping. |
| CRUD | Create, Read, Update, Delete — standard database operations. |
| Entity / Database Table | A data object that represents a real-world concept or item within the application domain. |
| Property / Database Field | A named element of an entity that holds a specific piece of data. |
| EAV Attribute | Entity-Attribute-Value: A flexible data modeling pattern for dynamic attributes. |
| Meta-Project | A Project corresponds to a Visual Studio Solution and a corresponding Database. |
| Meta-Keyword | Keywords used in Metadata, e.g. MaxLength, DefVal, Nullable |
| Meta-Template | Extensions to Metadata containing documentation and optional assets |
Requirements
MetaFirst runs on Windows, Linux, and macOS. The tool consists of a web-based UI and a backend service that generates ASP.NET Core solutions. The following requirements apply to all platforms.
General Requirements (all platforms)
- .NET 8 SDK or higher - Required to run MetaFirst and to build the generated solutions. Download: https://dotnet.microsoft.com
- Modern Web Browser - MetaFirst opens in the browser (Chrome, Edge, Firefox, Safari).
- 16 GB RAM recommended (8 GB minimum for smaller projects)
- At least 2 GB free disk space - Additional space may be required for generated projects.
- Internet access (optional) - Only required for checking updates or accessing templates from the MetaFirst website.
Windows Requirements
- Windows 10 or Windows 11 (64-bit) - Server editions (Windows Server 2019 / 2022) are also supported.
- .NET 8 SDK installed
- PowerShell 7 (optional) - Used for scripts such as run.bat, but not mandatory.
- SQL Server or SQL Express (optional) - Only needed if you want to run the generated projects with SQL Server locally.
Linux Requirements
MetaFirst supports most modern distributions:
Supported distributions:
- Ubuntu 20.04 / 22.04 or newer
- Debian 11 / 12
- Fedora 37+
- CentOS Stream / Rocky Linux / AlmaLinux
- openSUSE Leap / Tumbleweed
macOS Requirements
- macOS 12 Monterey, macOS 13 Ventura, or macOS 14 Sonoma
- .NET 8 SDK for macOS (Arm64 for Apple Silicon, x64 for Intel Macs)
- Terminal (included with macOS)
Quick Start
- Get the Metadata
- Start by using a sample MetaData file, like the ToDo_Metas.csv, to make you familiar with the code generation process.
- Later there are several ways to get the Metadata:
- By downloading Sample metadata from https://metafirst.silverconn.com/samples
- By using the Schema of your existing database
- Or by creating the Metadata from your Data analysis
- The file must be in UTF8, and the name must be YourProject_Metas.csv.
- Run the Application locally (Windows version)
- Install the application by unzipping the downloaded package to a folder on your PC, e.g. C:\MetaFirst, and click run.bat.
- Generate Code
- On the Scaffolding site, upload the Metadata csv file, and click the buttons for generating and downloading the Visual Studio solution
- Create or update the Database
- All the projects in the solution must compile without errors, otherwise the Migrations will fail
- With the PM console create the migrations and update the database.
- Run the Admin
- Adjust the appsettings in the Admin and WebAPI projects
- Start the applications in Visual Studio (F5)
Part 1 - Metadata
The only required input for generating a complete application with MetaFirst is the Metadata CSV file. The easiest way to edit this file is by using Notepad++ or any text editor of your choice, ideally starting from one of the provided Metadata templates.
If you are beginning from an existing database, you can automatically create the Metadata file from the database schema. If you are starting a new database project, first determine the structure of your data model—tables, fields, and their relationships—and define them in a new Metadata file.
Checking the Metadata Constraints
Adjusting Metadata is one of the most important tasks at the beginning of a project. MetaFirst helps you by providing a fast way to review the results immediately in the new generated Admin and API. After uploading the Metadata CSV file, MetaFirst validates the Metadata provided.
Data Types
Every property in the Metadata has its data type. MetaFirst generates code for the conversions between types and strings. Use the Meta keyword "HasColumnType" to specify what SQL type should be used in the Database.
Media Files
You can mark properties in the Metadata as Media data, like Images, Videos, Files, etc. The property contains a comma separated list of Media file names. Currently only one property can be used for each type of media file.
Schemas and Attributes
A Database Record can have, along their normal Field properties, also Fields that belong to a Schema. More Schemas may be assigned to a record. The Schema properties are called Attributes.
Metadata Editor
The Metadata Editor has a user interface to create or refine the Metadata file. After making changes, download the generated Metadata csv file, because the edited data is only stored temporarily in your systems Temp folder.
Part 2 - Running MetaFirst
See the Quick Start section about how to run the App on your local computer. This section explains how to update and merge additional code generations.
Updating the Code
After running the Code generation there are two options for how to update the Visual Studio Project with the new generated code: merging the full solution or merging only generated files with the CodeUpdater.
Part 3 - The Generated Code
Overview
Now you have a complete Visual Studio Solution with the following Projects:
| Project | Dependent of | Info |
|---|---|---|
| Core Libs | ||
| Meta | No dependency | Contains the Metadata Layer with the Metadata store and functionality |
| BaseData | Meta | Contains base Interfaces and Data helper, Repository implementations |
| Project specific Base | ||
| _Abstractions | Meta, BaseData | Contains the POCO classes with Extensions |
| _Ef | Meta, BaseData, Abstractions | Entity Framework Layer with DbContext and CRUD services |
| _Base | Meta, BaseData, _Abstractions, _Ef | Base Layer configurable for EF, WebAPI, or Repository access |
| Applications Layer | ||
| _WebApi | Meta, BaseData, _Abstractions, _Ef | RESTful WebAPI for data access through HTTP |
| _Admin | Meta, BaseData, _Abstractions, _Ef | Full CRUD Admin UI with Media Manager and Identity |
| Tests | ||
| UnitTest_ | All layers | Comprehensive tests for Abstractions, EF, Base, and WebAPI |
Part 3.1 - Core Libraries
The Meta Library contains methods for querying and manipulating the Metadata. The Base Data Library contains the Interfaces for data entities and properties, Reflection helpers, and Repository implementations.
Part 3.2 - Abstractions
The POCO classes generated by MetaFirst form the core of the Abstractions Layer. These smart model classes are enriched with logic derived directly from the Metadata including validation, formatting, defaults, and relationships.
Part 3.3 - EF Core Integration
Entity Framework Core serves as the ORM to interact with databases. The EF Core layer includes the DbContext, DbSet collections, model configuration, and migrations to manage schema changes.
Part 3.4 - Base Data Access Layer
This layer can be used by ASP.NET Core applications to access data through a Repository or WebAPI instead of EF directly. Configuration is set via the [Project]_Settings file for DataAccess modes (Ef, WebApi, Repo).
Part 3.5 - Application Layer
The Application Layer includes the Admin application for data management, the WebAPI for programmatic access, and frontend applications implementing user-facing functionality. All API requests are authenticated using JWT Bearer tokens.
Part 3.6 - Test Project
The generated Test project is a NUnit test project with tests for Base methods, EF CRUD operations, and WebAPI/Repository access. Always use a Test database, never test with Live data.
Part 4 - Frontend Applications
The generated code provides an Infrastructure for Frontends of any kind: ASP.NET Core applications with server-side rendering and direct DB access, or client-side apps (Vue, React, Angular) that access data through the WebAPI.
Part 5 - Templates
The recommended approach for extending the generated solution is to use Templates. Templates include descriptions, usage instructions, and may contain Metadata and assets such as libraries or components.
| Template name | Info |
|---|---|
| EntityDescript | Store description and image metadata about every entity |
| Dictionary | Provide languages and translations for your system |
| SectionsCms | Simple CMS allowing differentiation between Domain and CMS data |
| EcommerceStore | Simple Webshop with Categories, Products, Customers, Orders, Cart |
| BackendUserProfile | Add additional data to Backend user Identity Account |
| NumberRange | Generates numbers from a Number range |
| EntityHistory | Stores Entity data changes with date and user |
| PropertyHistory | Stores Entity property changes with date and user |
| Webhooks | Posts data after CRUD events to subscribers |
Appendix - Meta Keywords
Many keywords influence the database structure. When those keywords are modified, the DbContext builder will also change accordingly. Template-specific keywords do not require a new code generation.
For the complete keyword reference table, see the full documentation file or visit the MetaFirst website.
Appendix - Example Metadata File
Example of a Metadata file for a simple database with Tables for Animal, Food and AnimalFood. The format is: Entity;Field;Type;Attributes
Animal;Ident;int;Key,Generated,SurrogateKey,DefVal=0,Export,Import,Extendable,Activatable,Audit...
Animal;Name;string;IsUnique,MaxLength=100,DefVal=,Export,Import,TestVal=Dog,Doc=Unique animal name
Animal;Price;decimal;Precision=18.2,DefVal=0,Export,Import,TestVal=19,Doc=Animal price
Food;Id;long;Key,Generated,SurrogateKey,DefVal=0,Export,Import,TestVal=1,Name=Name...
Food;Name;string;IsUnique,MaxLength=100,DefVal=,Export,Import,TestVal=Super-Bone...Appendix - SQL Query Schema Script
Use the script included in the installation package (SQLQuerySchema.sql) to extract the schema of an existing database. Run the script in SSMS, save the result as CSV, add the header, and use the MetaFirst Editor to generate the corresponding Metadata file.
Appendix - Development Process for Data-Centric Applications
Developing a data-centric application revolves around the design, manipulation, and persistence of structured data. The process includes requirements analysis, data modeling, metadata definition, code generation, business logic implementation, frontend integration, testing, deployment, and ongoing maintenance.