中 | EN
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.
MASA.Contrib
├── solution items
│ ├── nuget.config
├── src
│ ├── Data
│ │ ├── MASA.Contrib.Data.UoW.EF Unit of work
│ │ └── MASA.Contribs.Data.Contracts.EF Protocol EF version
│ ├── DDD
│ │ ├── MASA.Contribs.DDD.Domain In-process and cross-process support
│ │ └── MASA.Contribs.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.Contribs.DDD.Domain.Tests
│ ├── MASA.Contribs.DDD.Domain.Repository.EF.Tests
What is MinimalAPI?Usage introduction
Advantage:
- Classify APIs and add them to different Services to make the Service structure clearer and get rid of running account programming
Advantage:
- Arrangement of Handler
- Implement Saga
- Middleware
- Transaction
Effect:
- Event and Handler decoupling
- Arrangement of Handler
- Implement Saga
- Middleware
- Transaction
what isCQRS?Usage introduction
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
Advantage:
- CQRS
- Field Service
- Support domain events (in-process), integrated domain events (cross-process)
- Support the unified sending of field events after being pushed onto the stack
DDD // todo
Protocol based on EF implementation,Usage introduction
Advantage:
- Filter deleted information when querying
- Open transaction after query
- Soft delete
Install-Package MASA.Contribs.Data.Contracts.EF
builder.Services
.AddUoW<CustomDbContext>(dbOptions =>
{
dbOptions.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity");
dbOptions.UseSoftDelete(builder.Services);//Start soft delete
})
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.
To ensure the reliability of the entire source code, the unit test coverage is at least 90%