-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* #23 Repository pattern implementation * fix tests
- Loading branch information
Showing
22 changed files
with
116 additions
and
44 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
6 changes: 6 additions & 0 deletions
6
src/NKZSoft.Template.Application/Common/Repositories/IToDoItemRepository.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,6 @@ | ||
namespace NKZSoft.Template.Application.Common.Repositories; | ||
|
||
public interface IToDoItemRepository : IRepositoryBase<ToDoItem> | ||
{ | ||
|
||
} |
6 changes: 6 additions & 0 deletions
6
src/NKZSoft.Template.Application/Common/Repositories/IToDoListRepository.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,6 @@ | ||
namespace NKZSoft.Template.Application.Common.Repositories; | ||
|
||
public interface IToDoListRepository : IRepositoryBase<ToDoList> | ||
{ | ||
|
||
} |
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
10 changes: 5 additions & 5 deletions
10
src/NKZSoft.Template.Application/TodoItems/Commands/Create/CreateTodoItemCommandHandler.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
14 changes: 7 additions & 7 deletions
14
src/NKZSoft.Template.Application/TodoItems/Commands/Delete/DeleteTodoItemCommandHandler.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
19 changes: 10 additions & 9 deletions
19
src/NKZSoft.Template.Application/TodoItems/Queries/GetPage/GetPageTodoQueryHandler.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
13 changes: 13 additions & 0 deletions
13
src/NKZSoft.Template.Application/TodoItems/Specifications/ToDoItemByIdSpecification.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,13 @@ | ||
namespace NKZSoft.Template.Application.TodoItems.Specifications; | ||
|
||
public sealed class ToDoItemByIdSpecification : Specification<ToDoItem>, ISingleResultSpecification<ToDoItem> | ||
{ | ||
public ToDoItemByIdSpecification(Guid id, bool noTracking = false) | ||
{ | ||
Query.Where(i => i.Id == id); | ||
if (noTracking) | ||
{ | ||
Query.AsNoTracking(); | ||
} | ||
} | ||
} |
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
2 changes: 1 addition & 1 deletion
2
src/NKZSoft.Template.Persistence.PostgreSQL/Database/Configurations/ToDoItemConfiguration.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
2 changes: 1 addition & 1 deletion
2
...Soft.Template.Persistence.PostgreSQL/Database/Configurations/ToDoItemListConfiguration.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
14 changes: 14 additions & 0 deletions
14
src/NKZSoft.Template.Persistence.PostgreSQL/Repositories/ToDoItemRepository.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 @@ | ||
namespace NKZSoft.Template.Persistence.PostgreSQL.Repositories; | ||
|
||
using Application.Common.Repositories; | ||
|
||
public class ToDoItemRepository : RepositoryBase<ToDoItem>, IToDoItemRepository | ||
{ | ||
public ToDoItemRepository(IApplicationDbContext dbContext) : base(dbContext.AppDbContext) | ||
{ | ||
} | ||
|
||
public ToDoItemRepository(IApplicationDbContext dbContext, ISpecificationEvaluator specificationEvaluator) : base(dbContext.AppDbContext, specificationEvaluator) | ||
{ | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/NKZSoft.Template.Persistence.PostgreSQL/Repositories/ToDoListRepository.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 @@ | ||
namespace NKZSoft.Template.Persistence.PostgreSQL.Repositories; | ||
|
||
using Application.Common.Repositories; | ||
|
||
public class ToDoListRepository : RepositoryBase<ToDoList>, IToDoListRepository | ||
{ | ||
public ToDoListRepository(IApplicationDbContext dbContext) : base(dbContext.AppDbContext) | ||
{ | ||
} | ||
|
||
public ToDoListRepository(IApplicationDbContext dbContext, ISpecificationEvaluator specificationEvaluator) | ||
: base(dbContext.AppDbContext, specificationEvaluator) | ||
{ | ||
} | ||
} |
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,4 +1,6 @@ | ||
global using Xunit; | ||
global using MediatR; | ||
global using Moq; | ||
global using FluentAssertions; | ||
global using FluentAssertions; | ||
global using NKZSoft.Template.Application.Common.Repositories; | ||
global using NKZSoft.Template.Persistence.PostgreSQL.Repositories; |
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