Revo.Infrastructure
1.38.2
dotnet add package Revo.Infrastructure --version 1.38.2
NuGet\Install-Package Revo.Infrastructure -Version 1.38.2
<PackageReference Include="Revo.Infrastructure" Version="1.38.2" />
<PackageVersion Include="Revo.Infrastructure" Version="1.38.2" />
<PackageReference Include="Revo.Infrastructure" />
paket add Revo.Infrastructure --version 1.38.2
#r "nuget: Revo.Infrastructure, 1.38.2"
#:package Revo.Infrastructure@1.38.2
#addin nuget:?package=Revo.Infrastructure&version=1.38.2
#tool nuget:?package=Revo.Infrastructure&version=1.38.2
<p align="center"> <img src="https://github.com/revoframework/Revo/blob/develop/res/revo-framework.png" alt="Revo framework"> </p> <p align="center"> <a href="https://dev.azure.com/revoframework/Revo/_build?definitionId=1&view=runs"><img src="https://img.shields.io/azure-devops/build/revoframework/7ff8258b-dd3c-4007-9d06-7609742e93cf/1/develop?style=flat-square&logo=azure-pipelines" alt="Build status"></a> <a href="https://codecov.io/gh/revoframework/Revo"><img src="https://img.shields.io/codecov/c/github/revoframework/Revo?logo=codecov&style=flat-square" alt="Code coverage"></a> <a href="https://github.com/revoframework/Revo/releases"><img src="https://img.shields.io/github/release-date/revoframework/Revo?label=latest%20release&style=flat-square" alt="Latest release date"></a> <a href="https://www.nuget.org/packages?q=revo"><img src="https://img.shields.io/nuget/v/Revo.Core?logo=NuGet&style=flat-square" alt="NuGet packages"></a> <a href="https://pkgs.dev.azure.com/revoframework/_packaging/revoframework/nuget/v3/index.json"><img src="https://img.shields.io/badge/nuget%20CI-source-blue?logo=NuGet&style=flat-square" alt="CI NuGet feed at Azure"></a><br> <a href="https://revoframework.gitbook.io/revo/"><img src="https://img.shields.io/badge/docs-GITBOOK-blue.svg?style=flat-square" alt="Docs"></a> <a href="https://gitter.im/revoframework/Revo?utm_source=share-link&utm_medium=link&utm_campaign=share-link"><img src="https://img.shields.io/gitter/room/revoframework/Revo?color=4BB595&logo=gitter&&style=flat-square" alt="Gitter chat"></a> <a href="https://github.com/revoframework/Revo/pulls"><img src="https://img.shields.io/badge/PRs-welcome-green?style=flat-square" alt="PRs welcome"></a> <a href="https://github.com/revoframework/Revo/blob/develop/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="License"></a> </p>
Revo Framework
Revo is an application framework for modern server C#/.NET applications built with event sourcing, CQRS and DDD.
Development of this framework is supported by <a href="https://olify.io">OLIFY - smarter solution for facility management & maintenance.</a>
Contents
- 🏠 Home
- ⚡️ Features
- 👓 Super-short example
- 🚀 Getting started
- 📘 Full documentation
- 📦 Packages
- 📑 License
⚡️ Features
The project combines the concepts of event sourcing, CQRS and DDD to provide framework for building applications that are scalable, maintainable, can work in distributed environments and are easy to integrate with outside world. As such, it takes some rather opinionated approaches on the design of certain parts of its architecture. Revo also offers other common features and infrastructure that is often necessary for building complete applications – for example, authorizations, validations, messaging, integrations, multi-tenancy or testing. Furthermore, its extensions implement other useful features like entity history change-tracking, auditing or user notifications.
Domain-Driven Design
Building blocks for rich DDD-style domain models (aggregates, entities, value objects, domain events, repositories...).
Event Sourcing
Implementing event-sourced entity persistence with support for multiple event store backends (PostgreSQL, MSSQL, SQLite...).
CQRS
Segregating command and query responsibilities with:
- Commands and queries
- Command/query handlers
- Processing pipeline with filters for cross-cutting concerns (authorization, validation)
- Different read/write models
A/synchronous event processing
Support for both synchronous and asynchronous event processing, guaranteed at-least-once delivery, event queues with strict sequence ordering (optionally), event source catch-ups, optional pseudo-synchronous event dispatch for listeners (projectors, for example).
Data access
Thin abstraction layer for easy data persistence (e.g. querying read models) using Entity Framework Core, Entity Framework 6, RavenDB, testable in-memory database or other data providers. Includes support for simple database migrations.
Projections
Support for read-model projections with various backends (e.g. Entity Framework Core (PostgreSQL, MSSQL, SQLite,...), Entity Framework 6, RavenDB...), automatic idempotency- and concurrency-handling, etc.
SOA, messaging and integration
Scale and integrate by publishing and receiving events, commands and queries using common messaging patterns,<br>
e.g. with RabbitMQ message queue (using EasyNetQ connector or Rebus service bus).
Sagas
Coordinating long-running processes or inter-aggregate cooperation with sagas that react to events<br>(a.k.a. process managers).
Authorization
Basic permission/role-based ACL for commands and queries, fine-grained row filtering.
Other minor features:
- Validation for commands, queries and other structures.
- Jobs
- Multi-tenancy
- Event message metadata
- Event versioning
- Event upgrades
- Database migrations
- History and change-tracking
- User notifications: event-based, with different output channels (mail, etc.), aggregation, buffering, etc.
- .NET 6.0+ support (with integration for ASP.NET Core)
👓 Show me how it looks!
Super-short example of a simple application that can save tasks using event-sourced aggregates and then query them back from a RDBMS.
Event
The event that happens when changing a task's name.
public class TodoRenamedEvent : DomainAggregateEvent
{
public TodoRenamedEvent(string name)
{
Name = name;
}
public string Name { get; }
}
Aggregate
The task aggregate root.
public class Todo : EventSourcedAggregateRoot
{
public Todo(Guid id, string name) : base(id)
{
Rename(name);
}
protected Todo(Guid id) : base(id)
{
}
public string Name { get; private set; }
public void Rename(string name)
{
if (!Name != name)
{
Publish(new TodoRenamedEvent(name));
}
}
private void Apply(TodoRenamedEvent ev)
{
Name = ev.Name;
}
}
Command and command handler
Command to save a new task.
public class CreateTodoCommand : ICommand
{
public CreateTodoCommand(string name)
{
Name = name;
}
[Required]
public string Name { get; }
}