-
Notifications
You must be signed in to change notification settings - Fork 115
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
refactor(EntityFramework): support Masa.Utils 0.4.0-preview.1 #21
Merged
Merged
Changes from 8 commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c9d9fc8
refactor(Contracts.EF): delete SoftDelete
zhenlei520 cc719f4
chore: update Masa.Utils library package version
zhenlei520 d46671f
refactor(Repository.EF): Remove the individually specified Assembly
zhenlei520 e3b150d
refactor(UoW): Refactor UnitOfWork to delay getting DbContext
zhenlei520 0172c07
refactor(EventLogs.EF): Refactored EventLogs.EF to adapt to Masa.Util…
zhenlei520 08dffdf
test: Refactoring and adaptation
zhenlei520 c813089
docs(Ddd.Domain): adjust Masa.Contrib.Ddd.Domain doc
zhenlei520 63c7307
chore:(UoW): Adjust global using
zhenlei520 6783460
docs(UoW): adjust Uow readme
zhenlei520 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,3 @@ | ||
[中](README.zh-CN.md) | EN | ||
|
||
## Contracts.EF | ||
|
||
Example: | ||
|
||
```C# | ||
Install-Package Masa.Contrib.Data.UoW.EF | ||
Install-Package Masa.Contrib.Data.Contracts.EF | ||
``` | ||
|
||
```C# | ||
builder.Services.AddEventBus(options => { | ||
options.UseUoW<CustomDbContext>(dbOptions => dbOptions.UseSoftDelete().UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity")); | ||
}); | ||
``` | ||
|
||
> 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 | ||
|
||
> Frequently Asked Questions: | ||
|
||
- Problem 1: After using UseSoftDelete, there is a problem that the submission cannot be saved | ||
|
||
After using Uow, the transaction will be enabled by default after Add、 Modified、 and Deleted | ||
and the transaction can be saved normally after the transaction is submitted | ||
If the EventBus is used, the transaction will be automatically submitted | ||
## Contracts.EF |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,3 @@ | ||
中 | [EN](README.md) | ||
|
||
## Contracts.EF | ||
|
||
用例: | ||
|
||
```C# | ||
Install-Package Masa.Contrib.Data.UoW.EF | ||
Install-Package Masa.Contrib.Data.Contracts.EF | ||
``` | ||
|
||
```C# | ||
builder.Services.AddEventBus(options => { | ||
options.UseUoW<CustomDbContext>(dbOptions => dbOptions.UseSoftDelete().UseSqlServer("server=localhost;uid=sa;pwd=P@ssw0rd;database=identity")); | ||
}); | ||
``` | ||
|
||
> 当实体继承ISoftware,且被删除时,将删除状态改为修改状态,并配合自定义Remove操作,实现软删除 | ||
> 支持查询的时候不查询被标记软删除的数据 | ||
|
||
> 常见问题: | ||
|
||
- 问题1:使用UseSoftDelete后出现提交保存不上的问题 | ||
|
||
使用Uow后,默认在进行Add、Modified、Deleted后会启用事务 | ||
需要提交事务之后才能正常保存 | ||
如果使用EventBus则会自动提交事务 | ||
## Contracts.EF |
28 changes: 0 additions & 28 deletions
28
src/Data/Masa.Contrib.Data.Contracts.EF/ServiceCollectionExtensions.cs
This file was deleted.
Oops, something went wrong.
19 changes: 0 additions & 19 deletions
19
src/Data/Masa.Contrib.Data.Contracts.EF/SoftDelete/QueryFilterProvider.cs
This file was deleted.
Oops, something went wrong.
17 changes: 0 additions & 17 deletions
17
src/Data/Masa.Contrib.Data.Contracts.EF/SoftDelete/SoftDeleteSaveChangesFilter.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +0,0 @@ | ||
global using Masa.BuildingBlocks.Data.Contracts; | ||
global using Masa.BuildingBlocks.Data.UoW; | ||
global using Masa.Contrib.Data.Contracts.EF.SoftDelete; | ||
global using Masa.Utils.Data.EntityFrameworkCore; | ||
global using Microsoft.EntityFrameworkCore; | ||
global using Microsoft.EntityFrameworkCore.ChangeTracking; | ||
global using Microsoft.EntityFrameworkCore.Metadata; | ||
global using Microsoft.Extensions.DependencyInjection; | ||
global using System.Linq.Expressions; | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Whether references to Contracts can be removed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it can be deleted, I missed it here, processed