Table of Contents

Generated solution structure

When Neos generates a backend application from your YAML metadata, it produces a .NET solution organized into multiple projects following Clean Architecture principles. This article describes the structure of the generated solution and the purpose of each project.

Solution overview

A typical generated solution (e.g., TechnicalDemos.slnx) contains the following projects:

server/
├── {ClusterName}.slnx                             # Main solution file
├── {ClusterName}.AspNetCore/                      # Presentation layer
├── {ClusterName}.Application/                     # Application layer
├── {ClusterName}.Application.Abstractions/        # Application interfaces and contracts
├── {ClusterName}.AutoGenerated.Application/       # Auto-generated application code
├── {ClusterName}.CSharpAbstractions/              # UI view abstractions (transpiled to TypeScript)
├── {ClusterName}.Domain/                          # Domain layer
├── {ClusterName}.Persistence/                     # Infrastructure layer
├── {ClusterName}.Persistence.Abstractions/        # Persistence interfaces
└── {ClusterName}.TaskRunner/                      # Background task execution
flowchart TB
    subgraph Presentation["Presentation Layer"]
        ASP["{ClusterName}.AspNetCore"]
    end
    
    subgraph Application["Application Layer"]
        APP["{ClusterName}.Application"]
        ABS["{ClusterName}.Application.Abstractions"]
        AUTO["{ClusterName}.AutoGenerated.Application"]
        UI["{ClusterName}.CSharpAbstractions"]
    end
    
    subgraph Domain["Domain Layer"]
        DOM["{ClusterName}.Domain"]
    end
    
    subgraph Infrastructure["Infrastructure Layer"]
        PERS["{ClusterName}.Persistence"]
        PABS["{ClusterName}.Persistence.Abstractions"]
    end
    
    ASP --> APP
    ASP --> ABS
    APP --> DOM
    APP --> ABS
    AUTO --> APP
    PERS --> DOM
    PERS --> PABS
    
    style Presentation fill:#fff3e0,color:#000
    style Application fill:#e3f2fd,color:#000
    style Domain fill:#e8f5e9,color:#000
    style Infrastructure fill:#fce4ec,color:#000
Important

The {ClusterName}.Domain project must not reference {ClusterName}.Application or {ClusterName}.Application.Abstractions. Dependencies must point inward: Domain is independent and has no knowledge of outer layers.

Project details

AspNetCore project

The {ClusterName}.AspNetCore project is the entry point of the application and represents the Presentation layer. It contains:

Directory/File Description
Program.cs Application entry point using WebHost.RunAsync<Startup>()
Startup.cs Service configuration and dependency injection setup
Controllers/ REST API controllers
Controllers/EntityViews/ Controllers for each entity view
Controllers/Methods/ Server method controllers
appsettings.json Application configuration

Application project

The {ClusterName}.Application project contains the Application layer logic:

Directory Description
EntityViews/ Entity view implementations (e.g., CustomerView.cs)
Persistence/ Entity view repository implementations
Descriptors/ Metadata descriptors for entity views
Notifications/ Real-time notification implementations
OData/ OData query support
Registrations/ Service registration helpers

Application.Abstractions project

The {ClusterName}.Application.Abstractions project defines interfaces and contracts for the application layer:

Directory Description
EntityViews/ Entity view interfaces (e.g., ICustomerView)
Persistence/ Repository interfaces for entity views
Methods/ Server method interfaces
Notifications/ Notification interfaces
Rules/ Validation and event rule interfaces
DataObjects/ Data transfer objects defined in the Application layer
Note

When you create a business assembly in the Application layer, it references this project. This allows your business code to access entity view interfaces, repository contracts, and other application-level abstractions without depending on their implementations.

CSharpAbstractions project

The {ClusterName}.CSharpAbstractions project contains UI view abstractions written in C# that are transpiled to TypeScript during generation. This project includes:

  • UI view definitions
  • Client-side methods
  • Pre-validation rules
  • Event rules for UI interactions
Note

Code in this project is written in C# for developer convenience, but it is transpiled to TypeScript during generation. The resulting TypeScript code runs in the browser as part of the Vue.js frontend application.

Domain project

The {ClusterName}.Domain project represents the core business logic and contains:

Directory Description
Entities/ Entity classes (e.g., Customer.cs)
Enums/ Enumeration definitions
Interfaces/ Entity and business interfaces
Persistence/ Repository interfaces
Rules/ Entity validation and event rules
Constants/ Business constants
DataObjects/ Data transfer objects defined in the Domain layer
Note

When you create a business assembly in the Domain layer, it references this project. This allows your business code to access entities, repository interfaces, and other domain-level abstractions.

Persistence project

The {ClusterName}.Persistence project implements data access using Entity Framework Core:

Directory/File Description
DatabaseContext.cs EF Core DbContext with all DbSet definitions
Configurations/ Entity type configurations (table mappings, indexes, relationships)
Repositories/ Repository implementations for each entity
ProgrammableObjects/ Database stored procedures and functions
PersistenceServices.cs Service registration for repositories

TaskRunner project

The {ClusterName}.TaskRunner project handles background task execution. It runs as a separate process and executes scheduled tasks and background server methods.

Data flow through layers

Understanding how data flows through the layers helps you decide where to place your code:

sequenceDiagram
    participant Client
    participant Controller
    participant EntityView
    participant Repository
    participant Entity
    participant Database

    Client->>Controller: HTTP Request
    Controller->>EntityView: Load/Create EntityView
    EntityView->>Repository: Query data
    Repository->>Database: SQL Query
    Database-->>Repository: Raw data
    Repository-->>Entity: Hydrated entities
    Entity-->>EntityView: Bound entity
    EntityView-->>Controller: EntityView response
    Controller-->>Client: HTTP Response

Generated vs business code

The Neos framework generates most of the solution structure. Your business code goes into business assemblies:

Generated (don't modify) Business code (your code)
Entity classes Entity validation rules
Entity view classes Entity view validation rules
Repository implementations Entity event rules
Controllers Entity view event rules
Database configurations Server methods
Service registrations Custom helpers and services
Important

Generated files are overwritten during each generation. Place your business logic in business assembly projects to preserve your code.

See also