Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tag: 0.3.0-preview.1 #10

Merged
merged 51 commits into from
Feb 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
51 commits
Select commit Hold shift + click to select a range
aeb898b
chore: update readme
doddgu Oct 20, 2021
121ba8c
Merge branch 'develop' of http://gitlab-hz.lonsid.cn/MASA-Stack/Contr…
doddgu Oct 20, 2021
c9ba05f
Merge branch 'docs/contrib' of...
Oct 20, 2021
ecf682a
fix: Fix the problem of failing to get context after enabling soft de…
Oct 22, 2021
ac06265
Configuration and UnitTest
Nov 15, 2021
ff884b8
chore: support net6.0
Nov 15, 2021
f994c80
Doc/contrib
Nov 17, 2021
94b59f3
Feature/optimize
Nov 23, 2021
ff4e9ac
chore: add package CI
doddgu Nov 23, 2021
dc33a5d
chore: update library package
Nov 23, 2021
e8b9beb
chore: add Codecov
doddgu Nov 23, 2021
1f247e7
chore: update codecov
doddgu Nov 23, 2021
73a7493
chore: update codecov
doddgu Nov 23, 2021
ee81ac4
docs: add codecov badge
doddgu Nov 23, 2021
e829239
chore: codecov ignore tests
doddgu Nov 23, 2021
9020481
chore: update codecov
doddgu Nov 23, 2021
c52e535
chore: update codecov
doddgu Nov 23, 2021
a5ebb5e
Update packge.yml
Nov 24, 2021
f291f21
Feature/ci
Nov 24, 2021
7244962
🆕 feat(minimal-apis): Improve MapGet, MapPost, MapPut and MapDelete w…
capdiem Dec 9, 2021
4a3660f
🐛 fix: Combine baseUri and customUri
Dec 10, 2021
00a9342
Update .gitlab-ci.yml
Dec 10, 2021
34298df
更新.gitlab-ci.yml文件
Dec 10, 2021
9643928
Delete .gitlab-ci.yml
Dec 10, 2021
3f872d4
chore: change fileName
Dec 13, 2021
ad52b8a
chore: update dapr library package
Dec 23, 2021
3a2907b
chore: change readme
Dec 30, 2021
ac7ecba
chore: Added a solution to the failure to obtain the Event relationsh…
zhenlei520 Jan 11, 2022
9414348
Fix/event
Jan 12, 2022
e2faf28
add ghpackageconfig
Jan 13, 2022
599c7a7
Update package_push_github.yml
PollosD Jan 17, 2022
e08b2f7
Update package_push_nuget.org.yml
PollosD Jan 17, 2022
37dc401
Update nuget.config
PollosD Jan 17, 2022
e00c5ff
Update nuget.config
PollosD Jan 17, 2022
30957eb
Update package_push_nuget.org.yml
PollosD Jan 17, 2022
b12cc22
Update package_push_github.yml
PollosD Jan 17, 2022
a1e3dc5
Update nuget.config
PollosD Jan 17, 2022
4c4543c
chore: Modify the introduction of Uow usage documentation (#3)
zhenlei520 Jan 21, 2022
52e4573
Update package_push_github.yml
PollosD Jan 24, 2022
85b0378
Update nuget.config
PollosD Jan 24, 2022
a139bb0
feat:event bus
zhenlei520 Feb 18, 2022
bf11040
fix: Fixed an error in the PublishQueueAsync method in the IDomainEve…
zhenlei520 Feb 21, 2022
c84102c
Squashed 'src/MASA.BuildingBlocks/' content from commit b6a2d36
Feb 21, 2022
71a9f4e
Merge commit 'c84102c44aa5b67bb9e7d5dcc7796f91987754e0' as 'src/MASA.…
Feb 21, 2022
59ff69b
update src
Feb 22, 2022
52138c5
add buildingblock
Feb 22, 2022
0cca71f
update action
Feb 22, 2022
d346cf8
Delete package_push_github.yml
PollosD Feb 22, 2022
c7a9761
Update package_push_nuget.org.yml
PollosD Feb 22, 2022
039e675
refactor: project references building blocks
zhenlei520 Feb 23, 2022
44df4bf
Update package_push_nuget.org.yml
PollosD Feb 23, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions .github/workflows/package_push_nuget.org.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Package Push Nuget
on:
release:
types: [ created ]

jobs:
package-build:
name: packeg build and push
runs-on: ubuntu-latest
steps:
- name: git pull
uses: actions/checkout@v2

- name: run a one-line script
run: env

- name: setting dotnet version
uses: actions/setup-dotnet@v1
with:
dotnet-version: '6.0.x'
include-prerelease: true
- name: dependencies
- run: git clone -b main https://github.com/masastack/MASA.BuildingBlocks.git ./src/BuildingBlocks

- name: restore
run: dotnet restore

- name: build
run: dotnet build --no-restore /p:ContinuousIntegrationBuild=true

- name: test
run: dotnet test --no-build --verbosity normal /p:CollectCoverage=true /p:CoverletOutputFormat=opencover /p:Exclude="[*.Tests]*"

- name: codecov
uses: codecov/codecov-action@v1

- name: pack
run: dotnet pack --include-symbols -p:PackageVersion=$GITHUB_REF_NAME

- name: package push
run: dotnet nuget push "**/*.symbols.nupkg" -k ${{secrets.NUGET_TOKEN}} -s https://api.nuget.org/v3/index.json

32 changes: 0 additions & 32 deletions .gitlab-ci.yml

This file was deleted.

3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "src/BuildingBlocks/MASA.BuildingBlocks"]
path = src/BuildingBlocks/MASA.BuildingBlocks
url = https://github.com/masastack/MASA.BuildingBlocks.git
24 changes: 24 additions & 0 deletions Directory.Build.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<Project>
<PropertyGroup>
<PackageId>$(AssemblyName)</PackageId>
<PackageIcon>packageIcon.png</PackageIcon>
<Authors>masastack</Authors>
<Copyright>© masastack Corporation. All rights reserved.</Copyright>
<PackageIconUrl>packageIcon.png</PackageIconUrl>
<RepositoryUrl>https://github.com/masastack/MASA.Contrib</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PublishRepositoryUrl>true</PublishRepositoryUrl>
<RepositoryRoot>$(MSBuildThisFileDirectory)</RepositoryRoot>
<PackageLicenseFile>LICENSE.txt</PackageLicenseFile>
</PropertyGroup>
<ItemGroup>
<None Include="$(RepositoryRoot)packageIcon.png">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
<None Include="$(RepositoryRoot)LICENSE.txt">
<Pack>True</Pack>
<PackagePath></PackagePath>
</None>
</ItemGroup>
</Project>
File renamed without changes.
345 changes: 291 additions & 54 deletions MASA.Contrib.sln

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions NuGet.Config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
</packageSources>
</configuration>
73 changes: 42 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,38 @@
[中](README.zh-CN.md) | EN

[![codecov](https://codecov.io/gh/masastack/MASA.Contrib/branch/develop/graph/badge.svg?token=87TPNHUHW2)](https://codecov.io/gh/masastack/MASA.Contrib)

# MASA.Contrib

MASA.Contrib is the best practice of MASA.BuildingBlocks
The purpose of MASA.Contrib is based on [MASA.BuildingBlocks](https://github.com/masastack/MASA.BuildingBlocks) to provide open, community driven reusable components for building mesh applications. These components will be used by the [MASA Stack](https://github.com/masastack) and [MASA Labs](https://github.com/masalabs) projects.

## Structure

```c#
MASA.Contrib
│──solution items
│ ── nuget.config
│──src
├── 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.Contribs.Data.Contracts.EF Protocol EF version
│ │ ├── MASA.Contrib.Data.UoW.EF Unit of work
│ │ └── MASA.Contrib.Data.Contracts.EF Protocol EF version
│ ├── DDD
│ │ ├── MASA.Contribs.DDD.Domain In-process and cross-process support
│ │ └── MASA.Contribs.DDD.Domain.Repository.EF
│ │ ├── 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.Events In-process event
│ │ ├── MASA.Contrib.Dispatcher.IntegrationEvents.Dapr
│ │ └── MASA.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF Cross-process event
│ │ └── MASA.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF Cross-process event
│ ├── ReadWriteSpliting
│ │ └── CQRS
│ │ │ └── MASA.Contrib.ReadWriteSpliting.CQRS CQRS
│ │ │ └── MASA.Contrib.ReadWriteSpliting.CQRS CQRS
│ ├── Service
│ │ └── MASA.Contrib.Service.MinimalAPIs Best practices for [MinimalAPI]
│──test
│ │ └── MASA.Contrib.Service.MinimalAPIs Best practices for [MinimalAPI]
├── test
│ ├── MASA.Contrib.Dispatcher.Events
│ │ ├── MASA.Contrib.Dispatcher.Events.BenchmarkDotnetTest
│ │ ├── MASA.Contrib.Dispatcher.Events.CheckMethodsParameter.Tests
Expand All @@ -36,25 +42,25 @@ MASA.Contrib
│ │ ├── 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.Data.UoW.EF.Tests
│ ├── MASA.Contrib.Dispatcher.IntegrationEvents.EventLogs.EF.Tests
│ ├── MASA.Contribs.DDD.Domain.Tests
│ ├── MASA.Contribs.DDD.Domain.Repository.EF.Tests
│ ├── MASA.Contrib.DDD.Domain.Tests
│ ├── MASA.Contrib.DDD.Domain.Repository.EF.Tests
```

## Feature

### 1. MinimalAPI

What is [MinimalAPI](https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-6-preview-4/#introducing-minimal-apis)?[Usage introduction](http://gitlab-hz.lonsid.cn/MASA-Stack/Contribs/MASA.Contrib/-/tree/develop/src/Service/MASA.Contrib.Service.MinimalAPIs/README.md)
What is [MinimalAPI](https://devblogs.microsoft.com/aspnet/asp-net-core-updates-in-net-6-preview-4/#introducing-minimal-apis)?[Usage introduction](/src/Service/MASA.Contrib.Service.MinimalAPIs/README.md)

> 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](http://gitlab-hz.lonsid.cn/MASA-Stack/Contribs/MASA.Contrib/-/tree/develop/src/Dispatcher/MASA.Contrib.Dispatcher.Events/README.md)
[Usage introduction](/src/Dispatcher/MASA.Contrib.Dispatcher.Events/README.md)

> Advantage:
>
Expand All @@ -73,22 +79,22 @@ What is [MinimalAPI](https://devblogs.microsoft.com/aspnet/asp-net-core-updates-

### 3. CQRS

what is[CQRS](https://docs.microsoft.com/en-us/azure/architecture/patterns/cqrs)?[Usage introduction](http://gitlab-hz.lonsid.cn/MASA-Stack/Contribs/MASA.Contrib/-/tree/develop/src/ReadWriteSpliting/CQRS/MASA.Contrib.ReadWriteSpliting.CQRS/README.md)
what is[CQRS](https://docs.microsoft.com/en-us/azure/architecture/patterns/cqrs)?[Usage introduction](/src/ReadWriteSpliting/CQRS/MASA.Contrib.ReadWriteSpliting.CQRS/README.md)

### 4. IntegrationEventBus

Realize cross-process events based on Dapr。[Usage introduction](http://gitlab-hz.lonsid.cn/MASA-Stack/Contribs/MASA.Contrib/-/tree/develop/src/Dispatcher/MASA.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md)
Realize cross-process events based on Dapr。[Usage introduction](/src/Dispatcher/MASA.Contrib.Dispatcher.IntegrationEvents.Dapr/README.md)

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

### 5. DomainEventBus

[Usage introduction](http://gitlab-hz.lonsid.cn/MASA-Stack/Contribs/MASA.Contrib/-/tree/develop/src/DDD/MASA.Contribs.DDD.Domain/README.md)
[Usage introduction](/src/DDD/MASA.Contrib.DDD.Domain/README.md)

> Advantage:
>
> 1. CQRS
> 2. Field Service
> 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

Expand All @@ -99,35 +105,40 @@ Realize cross-process events based on Dapr。[Usage introduction](http://gitlab-

### 7. Contracts.EF

Protocol based on EF implementation,[Usage introduction](http://gitlab-hz.lonsid.cn/MASA-Stack/Contribs/MASA.Contrib/-/tree/develop/Data/MASA.Contribs.Data.Contracts.EF/README.md)
Protocol based on EF implementation,[Usage introduction](/Data/MASA.Contrib.Data.Contracts.EF/README.md)

> Advantage:
>
> 1. Filter deleted information when querying
> 2. Open transaction after query
> 3. Soft delete
> 2. Soft delete

```C#
Install-Package MASA.Contribs.Data.Contracts.EF
Install-Package MASA.Contrib.Data.Contracts.EF
```

```C#
builder.Services
.AddUoW<CustomDbContext>(dbOptions =>
builder.Services.AddEventBus(options => {
options.UseUoW<CustomDbContext>(dbOptions =>
{
dbOptions.UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity");
dbOptions.UseSoftDelete(builder.Services);//Start soft delete
})
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 introduction](src/Configuration/MASA.Contrib.Configuration/README.md) 、[Dcc Usage introduction](src/BasicAbility/MASA.Contrib.BasicAbility.Dcc/README.md)

## Unit testing rules

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

## ☀️ License agreement

[![MASA.Contrib](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](http://gitlab-hz.lonsid.cn/MASA-Stack/Contribs/MASA.Contrib/-/tree/develop/LICENSE)
[![MASA.Contrib](https://img.shields.io/badge/License-MIT-blue?style=flat-square)](/LICENSE.txt)
Loading