DSL Schema
The MasLazu.AspNet DSL is a Markdown-based format that uses Mermaid ER diagrams for visual modeling and simple tables/pseudocode for details.
Structure
A module definition DSL file consists of several sections:
- Module Config: YAML block with
moduleandnamespace. - Entities: Mermaid
erDiagramblock defining entities and relationships. - Constraints: Detailed property rules like Max Length, Required, Unique, and Default values.
- Indexes: Database index definitions.
- Contracts: Custom DTOs, Requests, and Responses.
- Services: Business logic defined in Pseudocode.
- Adapters: Inbound protocol handlers (HTTP, gRPC, Event Consumers, GraphQL).
- Events: Domain event definitions.
- Authorization: Access control rules per entity.
Example
Pseudocode Logic
Services use a simple pseudocode that AI translates to C#:
DeactivateAsync(productId: Guid) -> void
product = Products.find(productId) ?? throw NotFound
if product.IsActive:
product.IsActive = false
product.save()
publish ProductDeactivatedEvent(productId)
Reference
For the full schema specification, refer to the .ai/dsl/schema.md file in the repository.