-
-
Notifications
You must be signed in to change notification settings - Fork 198
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
320 additions
and
62 deletions.
There are no files selected for viewing
15 changes: 15 additions & 0 deletions
15
src/YesSql.Abstractions/Commands/DocumentChanged/DocumentChangeContext.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,15 @@ | ||
using System.Data.Common; | ||
|
||
namespace YesSql.Commands.DocumentChanged | ||
{ | ||
public class DocumentChangeContext | ||
{ | ||
public ISession Session { get; set; } | ||
public object Entity { get; set; } | ||
public Document Document { get; set; } | ||
public IStore Store { get; set; } | ||
public DbConnection Connection { get; set; } | ||
public DbTransaction Transaction { get; set; } | ||
public ISqlDialect Dialect { get; set; } | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
src/YesSql.Abstractions/Commands/DocumentChanged/DocumentChangedInBatchContext.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,14 @@ | ||
using System.Collections.Generic; | ||
using System.Data.Common; | ||
|
||
namespace YesSql.Commands.DocumentChanged | ||
{ | ||
public class DocumentChangeInBatchContext | ||
{ | ||
public object Entity { get; set; } | ||
public List<string> Queries { get; set; } | ||
public DbCommand BatchCommand { get; set; } | ||
public ISession Session { get; set; } | ||
public Document Document { get; set; } | ||
} | ||
} |
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
16 changes: 16 additions & 0 deletions
16
src/YesSql.Abstractions/Commands/IDocumentCommandHandler.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,16 @@ | ||
using System.Threading.Tasks; | ||
using YesSql.Commands.DocumentChanged; | ||
|
||
namespace YesSql.Commands | ||
{ | ||
public interface IDocumentCommandHandler | ||
{ | ||
Task CreatedAsync(DocumentChangeContext context); | ||
bool CreatedInBatch(DocumentChangeInBatchContext context); | ||
|
||
Task RemovingAsync(DocumentChangeContext context); | ||
bool RemovingInBatch(DocumentChangeInBatchContext context); | ||
Task UpdatedAsync(DocumentChangeContext context); | ||
bool UpdatedInBatch(DocumentChangeInBatchContext context); | ||
} | ||
} |
File renamed without changes.
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
File renamed without changes.
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 |
---|---|---|
@@ -0,0 +1,20 @@ | ||
using System.Threading.Tasks; | ||
using YesSql.Commands.DocumentChanged; | ||
|
||
namespace YesSql.Commands | ||
{ | ||
public class DefaultDocumentCommandHandler : IDocumentCommandHandler | ||
{ | ||
public Task CreatedAsync(DocumentChangeContext context) => Task.CompletedTask; | ||
|
||
public bool CreatedInBatch(DocumentChangeInBatchContext context) => true; | ||
|
||
public Task RemovingAsync(DocumentChangeContext context) => Task.CompletedTask; | ||
|
||
public bool RemovingInBatch(DocumentChangeInBatchContext context) => true; | ||
|
||
public Task UpdatedAsync(DocumentChangeContext context) => Task.CompletedTask; | ||
|
||
public bool UpdatedInBatch(DocumentChangeInBatchContext context) => true; | ||
} | ||
} |
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.