Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/masastack/MASA.Framework/llms.txt

Use this file to discover all available pages before exploring further.

MASA Framework is a .NET next-generation microservice development framework that delivers cloud-native best practices built on top of the Distributed Application Runtime (Dapr). It lets you compose modern applications — distributed systems, microservices, Domain-Driven Design, and multi-tenant SaaS platforms — from a rich set of independently installable building blocks, without locking your domain logic to any single vendor or technology.

Two-Layer Architecture

Every capability in MASA Framework is split into two complementary NuGet layers:
  • Masa.BuildingBlocks.* — Pure abstractions: interfaces, base classes, and contracts. Your domain and application code depends only on these packages.
  • Masa.Contrib.* — Concrete implementations: plug in the provider you need (SQL Server, Redis, Dapr, etc.) and swap it later without touching a single line of domain logic.
This separation means your business code stays clean and technology-agnostic while the infrastructure layer remains fully replaceable.
Because your service classes depend on Masa.BuildingBlocks abstractions, you can swap a Masa.Contrib implementation package — for example, switching from SQL Server to PostgreSQL — with just a one-line change in Program.cs.

Why Use MASA Framework?

Composable Packages

Install only the building blocks you need. Each block is a separate NuGet package; there is no monolithic framework dependency.

Dapr Integration

First-class Dapr support for service invocation, pub/sub integration events, distributed state, and secret management.

Swap Implementations Freely

Abstractions in Masa.BuildingBlocks mean you change a Contrib package, not your domain code, when switching databases or message brokers.

Full DDD Support

Aggregate roots, domain events, repositories, and CQRS patterns ship as first-class concepts in the framework.

Key Building Blocks

MASA Framework provides the following building blocks out of the box:
Building BlockPackage PrefixDescription
EventBusMasa.BuildingBlocks.Dispatcher.EventsIn-process event dispatching with middleware pipeline
Integration EventsMasa.BuildingBlocks.Dispatcher.IntegrationEventsCross-service pub/sub via Dapr
Minimal APIsMasa.BuildingBlocks.Service.MinimalAPIsConvention-based route auto-mapping via ServiceBase
CachingMasa.BuildingBlocks.CachingUnified distributed and multilevel cache abstractions
ConfigurationMasa.BuildingBlocks.ConfigurationPluggable configuration providers including DCC
DDDMasa.BuildingBlocks.Ddd.DomainAggregates, domain events, repositories
EF CoreMasa.Contrib.Data.EFCore.*EF Core integration for multiple databases
IsolationMasa.BuildingBlocks.IsolationMulti-tenant and multi-environment data isolation
Background JobsMasa.BuildingBlocks.Extensions.BackgroundJobsScheduled and queued job abstractions
Rules EngineMasa.BuildingBlocks.RulesEnginePluggable business rules evaluation
Object StorageMasa.BuildingBlocks.Storage.ObjectStorageCloud object storage abstractions
I18nMasa.BuildingBlocks.Globalization.I18nInternationalization and localization
CQRSMasa.BuildingBlocks.ReadWriteSplitting.CqrsCommand/Query separation scaffolding

NuGet Package Naming Convention

MASA Framework follows a consistent naming pattern that makes it easy to find and pair packages:
Masa.BuildingBlocks.<Category>[.<SubCategory>]   ← abstractions (always)
Masa.Contrib.<Category>[.<SubCategory>]          ← implementations (swap freely)
Examples:
Masa.BuildingBlocks.Dispatcher.Events            ← EventBus interface
Masa.Contrib.Dispatcher.Events                   ← EventBus implementation

Masa.BuildingBlocks.Caching                      ← IDistributedCacheClient interface
Masa.Contrib.Caching.Distributed.StackExchangeRedis  ← Redis implementation
Always add a Masa.BuildingBlocks.* reference for compile-time abstractions and a matching Masa.Contrib.* reference for the runtime implementation. Your domain projects should reference only Masa.BuildingBlocks.*.

License

MASA Framework is released under the MIT License. Copyright © 2021–present MASA Stack.

Explore Further

Quickstart

Build your first MASA Framework microservice with EventBus, Minimal APIs, and EF Core in five steps.

Architecture

Deep-dive into the BuildingBlocks/Contrib layering, MasaApp global service locator, and assembly scanning.

Event Bus

Learn how to publish and handle in-process events with the MASA EventBus and middleware pipeline.

DDD Overview

Understand how MASA Framework models aggregates, domain events, and repositories for DDD projects.

Build docs developers (and LLMs) love