-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #9 from mkolumb/feature/aftersavebehavior
Change accept changes flag to after save behavior enum
- Loading branch information
Showing
9 changed files
with
119 additions
and
59 deletions.
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
24 changes: 24 additions & 0 deletions
24
...ensions.SaveOptimizer/EFCore.Extensions.SaveOptimizer.Internal/Enums/AfterSaveBehavior.cs
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
namespace EFCore.Extensions.SaveOptimizer.Internal.Enums; | ||
|
||
public enum AfterSaveBehavior | ||
{ | ||
/// <summary> | ||
/// It is default behavior, it will call ChangeTracker.Clear to prevent double save | ||
/// </summary> | ||
ClearChanges, | ||
|
||
/// <summary> | ||
/// It will call ChangeTracker.AcceptAllChanges, however it will not refresh temporary values - if you have auto increment key you should not use this | ||
/// </summary> | ||
AcceptChanges, | ||
|
||
/// <summary> | ||
/// It will mark all saved entities as detached | ||
/// </summary> | ||
DetachSaved, | ||
|
||
/// <summary> | ||
/// Do nothing | ||
/// </summary> | ||
DoNothing | ||
} |
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
11 changes: 10 additions & 1 deletion
11
....SaveOptimizer/EFCore.Extensions.SaveOptimizer.Internal/Enums/ConcurrencyTokenBehavior.cs
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,7 +1,16 @@ | ||
namespace EFCore.Extensions.SaveOptimizer.Internal.Enums; | ||
// ReSharper disable UnusedMember.Global | ||
|
||
namespace EFCore.Extensions.SaveOptimizer.Internal.Enums; | ||
|
||
public enum ConcurrencyTokenBehavior | ||
{ | ||
/// <summary> | ||
/// It will throws exception when expected rows != affected rows | ||
/// </summary> | ||
ThrowException, | ||
|
||
/// <summary> | ||
/// It will skip entities with concurrency token changed, however will not throws exception | ||
/// </summary> | ||
SaveWhatPossible | ||
} |
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