a280238558 / MASA.Contrib

The purpose of MASA.Contrib is based on MASA.BuildingBlocks to provide open, community driven reusable components for building mesh applications. These components will be used by the MASA Stack and MASA Labs projects.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

| EN

codecov

MASA.Contrib

The purpose of MASA.Contrib is based on MASA.BuildingBlocks to provide open, community driven reusable components for building mesh applications. These components will be used by the MASA Stack and MASA Labs projects.

Structure

MASA.Contrib
├── solution items
│   ├── nuget.config
├── src
│   ├── BasicAbility
│   │   ├── MASA.Contrib.BasicAbility.Dcc                          ConfigurationAPI
│   ├── Configuration
│   │   ├── MASA.Contrib.Configuration
│   ├── Data
│   │   ├── MASA.Contrib.Data.UoW.EF                               Unit of work
│   │   └── MASA.Contrib.Data.Contracts.EF                        Protocol EF version
│   ├── DDD
│   │   ├── MASA.Contrib.DDD.Domain                               In-process and cross-process support
│   │   └── MASA.Contrib.DDD.Domain.Repository.EF
│   ├── Dispatcher
│   │   ├── MASA.Contrib.Dispatcher.Events                         In-process event
│   │   ├── MASA.Contrib.Dispatcher.IntegrationEvents.Dapr
│   │   └── MASA.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF Cross-process event
│   ├── ReadWriteSpliting
│   │   └── CQRS
│   │   │   └── MASA.Contrib.ReadWriteSpliting.CQRS                CQRS
│   ├── Service
│   │   └── MASA.Contrib.Service.MinimalAPIs                       Best practices for [MinimalAPI]
├── test
│   ├── MASA.Contrib.Dispatcher.Events
│   │   ├── MASA.Contrib.Dispatcher.Events.BenchmarkDotnetTest
│   │   ├── MASA.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests
│   │   ├── MASA.Contrib.Dispatcher.Events.CheckMethodsParameterNotNull.Tests
│   │   ├── MASA.Contrib.Dispatcher.Events.CheckMethodsParameterType.Tests
│   │   ├── MASA.Contrib.Dispatcher.Events.CheckMethodsType.Tests
│   │   ├── MASA.Contrib.Dispatcher.Events.OnlyCancelHandler.Tests
│   │   ├── MASA.Contrib.Dispatcher.Events.CheckMethodsType.Tests
│   │   ├── MASA.Contrib.Dispatcher.Events.Tests
│   ├── MASA.Contrib.Data.UoW.EF.Tests
│   ├── MASA.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests
│   ├── MASA.Contrib.DDD.Domain.Tests
│   ├── MASA.Contrib.DDD.Domain.Repository.EF.Tests

Feature

1. MinimalAPI

What is MinimalAPIUsage introduction

Advantage:

  1. Classify APIs and add them to different Services to make the Service structure clearer and get rid of running account programming

2. EventBus

Usage introduction

Advantage:

  1. Arrangement of Handler
  2. Implement Saga
  3. Middleware
  4. Transaction

Effect:

  1. Event and Handler decoupling
  2. Arrangement of Handler
  3. Implement Saga
  4. Middleware
  5. Transaction

3. CQRS

what isCQRSUsage introduction

4. IntegrationEventBus

Realize cross-process events based on Dapr。Usage introduction

Advantage:Use the same transaction to commit the user-defined context and the log to ensure atomicity and consistency

5. DomainEventBus

Usage introduction

Advantage:

  1. CQRS
  2. Domain Service
  3. Support domain events (in-process), integrated domain events (cross-process)
  4. Support the unified sending of field events after being pushed onto the stack

6. DDD

DDD // todo

7. Contracts.EF

Protocol based on EF implementation,Usage introduction

Advantage:

  1. Filter deleted information when querying
  2. Open transaction after query
  3. Soft delete
Install-Package MASA.Contrib.Data.Contracts.EF
builder.Services.AddEventBus(options => {
    options.UseUoW<CustomDbContext>(dbOptions =>
    {
        dbOptions.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity");
        dbOptions.UseSoftDelete(builder.Services);
    });
});

When the entity inherits ISoftware and is deleted, change the delete state to the modified state, and cooperate with the custom Remove operation to achieve soft deletion Do not query the data marked as soft deleted when querying When combined with EventBus, the transaction is opened after the first CUD, and the transaction rollback is supported when the entire Handler is abnormal.

8. MASA.Contrib.Configuration

Redefine Configuration, support the management of Local and ConfigurationAPI nodes, combine IOptions and IOptionsMonitor to complete configuration acquisition and configuration update subscription Local Usage introductionDcc Usage introduction

Unit testing rules

To ensure the reliability of the entire source code, the unit test coverage is at least 90%

☀️ License agreement

MASA.Contrib

About

The purpose of MASA.Contrib is based on MASA.BuildingBlocks to provide open, community driven reusable components for building mesh applications. These components will be used by the MASA Stack and MASA Labs projects.

License:MIT License


Languages

Language:C# 100.0%