-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
♻️ Use Immediate.Handlers instead of MediatR (#50)
cc: @viceroypenguin
- Loading branch information
Showing
15 changed files
with
80 additions
and
54 deletions.
There are no files selected for viewing
4 changes: 3 additions & 1 deletion
4
src/VerticalSliceArchitectureTemplate/Common/Domain/BaseEntity.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
3 changes: 2 additions & 1 deletion
3
src/VerticalSliceArchitectureTemplate/Common/Persistence/EventPublisher.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
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
4 changes: 3 additions & 1 deletion
4
src/VerticalSliceArchitectureTemplate/Features/Todos/Domain/Events/TodoCompletedEvent.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,3 +1,5 @@ | ||
namespace VerticalSliceArchitectureTemplate.Features.Todos.Domain.Events; | ||
using MediatR; | ||
|
||
namespace VerticalSliceArchitectureTemplate.Features.Todos.Domain.Events; | ||
|
||
public record TodoCompletedEvent(Guid TodoId) : INotification; |
4 changes: 3 additions & 1 deletion
4
src/VerticalSliceArchitectureTemplate/Features/Todos/Domain/Events/TodoCreatedEvent.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,3 +1,5 @@ | ||
namespace VerticalSliceArchitectureTemplate.Features.Todos.Domain.Events; | ||
using MediatR; | ||
|
||
namespace VerticalSliceArchitectureTemplate.Features.Todos.Domain.Events; | ||
|
||
public record TodoCreatedEvent(Guid TodoId) : INotification; |
18 changes: 18 additions & 0 deletions
18
src/VerticalSliceArchitectureTemplate/Features/Todos/Queries/GetAllTodos.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,18 @@ | ||
using VerticalSliceArchitectureTemplate.Features.Todos.Domain; | ||
|
||
namespace VerticalSliceArchitectureTemplate.Features.Todos.Queries; | ||
|
||
[Handler] | ||
public sealed partial class GetAllTodos | ||
{ | ||
public sealed record Query(bool? IsCompleted = null); | ||
|
||
private static async ValueTask<IReadOnlyList<Todo>> HandleAsync(Query request, AppDbContext dbContext, CancellationToken cancellationToken) | ||
{ | ||
var todos = await dbContext.Todos | ||
.Where(x => request.IsCompleted == null || x.IsCompleted == request.IsCompleted) | ||
.ToListAsync(cancellationToken); | ||
|
||
return todos.AsReadOnly(); | ||
} | ||
} |
18 changes: 0 additions & 18 deletions
18
src/VerticalSliceArchitectureTemplate/Features/Todos/Queries/GetAllTodosQuery.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
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