-
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.
- Loading branch information
Showing
48 changed files
with
801 additions
and
116 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
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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Empty file.
2 changes: 1 addition & 1 deletion
2
...utionCenter.Application/Tables/Components/Information/Bases/BaseEntityTableInformation.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
5 changes: 1 addition & 4 deletions
5
...utionCenter.Application/Tables/Components/Information/Concretes/ClientTableInformation.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
31 changes: 31 additions & 0 deletions
31
...onCenter.Application/Tables/Components/Information/Concretes/TransportTableInformation.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,31 @@ | ||
namespace DistributionCenter.Application.Tables.Components.Information.Concretes; | ||
|
||
using Bases; | ||
|
||
public class TransportTableInformation : BaseEntityTableInformation | ||
{ | ||
protected override string ObtainGetByIdFields() | ||
{ | ||
return "name, capacity, availableUnits"; | ||
} | ||
|
||
protected override string ObtainTableName() | ||
{ | ||
return "transport"; | ||
} | ||
|
||
protected override string ObtainCreateFields() | ||
{ | ||
return "name, capacity, availableUnits"; | ||
} | ||
|
||
protected override string ObtainCreateValues() | ||
{ | ||
return "@Name, @Capacity, @AvailableUnits"; | ||
} | ||
|
||
protected override string ObtainUpdateFields() | ||
{ | ||
return "name = @Name, capacity = @Capacity, availableUnits = @AvailableUnits"; | ||
} | ||
} |
2 changes: 1 addition & 1 deletion
2
src/DistributionCenter.Application/Tables/Components/QueryCommands/Bases/BaseCommand.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
src/DistributionCenter.Application/Tables/Components/QueryCommands/Bases/BaseQuery.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
6 changes: 3 additions & 3 deletions
6
...r.Application/Tables/Components/QueryCommands/Concretes/Dapper/Bases/BaseDapperCommand.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
12 changes: 6 additions & 6 deletions
12
...ication/Tables/Components/QueryCommands/Concretes/Dapper/Concretes/CreateDapperCommand.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
12 changes: 6 additions & 6 deletions
12
...lication/Tables/Components/QueryCommands/Concretes/Dapper/Concretes/GetByIdDapperQuery.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
12 changes: 6 additions & 6 deletions
12
...ication/Tables/Components/QueryCommands/Concretes/Dapper/Concretes/UpdateDapperCommand.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
21 changes: 21 additions & 0 deletions
21
...enter.Application/Tables/Components/QueryCommands/Concretes/File/Bases/BaseJsonCommand.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,21 @@ | ||
namespace DistributionCenter.Application.Tables.Components.QueryCommands.Concretes.File.Bases; | ||
|
||
using Connections.File.Interfaces; | ||
using DistributionCenter.Application.Tables.Components.QueryCommands.Bases; | ||
using DistributionCenter.Commons.Results; | ||
using DistributionCenter.Domain.Entities.Interfaces; | ||
|
||
public abstract class BaseJsonCommand<T>(IFileConnectionFactory<T> fileConnectionFactory, T entity) | ||
: BaseCommand<T>(entity) | ||
where T : IEntity | ||
{ | ||
public override async Task<Result> ExecuteAsync() | ||
{ | ||
List<T> data = await fileConnectionFactory.LoadDataAsync(); | ||
Result result = await Execute(data); | ||
|
||
return result; | ||
} | ||
|
||
protected abstract Task<Result> Execute(IEnumerable<T> data); | ||
} |
24 changes: 24 additions & 0 deletions
24
...nCenter.Application/Tables/Components/QueryCommands/Concretes/File/Bases/BaseJsonQuery.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 DistributionCenter.Application.Tables.Components.QueryCommands.Concretes.File.Bases; | ||
|
||
using Connections.File.Interfaces; | ||
using DistributionCenter.Application.Tables.Components.QueryCommands.Bases; | ||
using DistributionCenter.Commons.Results; | ||
using DistributionCenter.Domain.Entities.Interfaces; | ||
|
||
public abstract class BaseJsonQuery<T>(IFileConnectionFactory<T> fileConnectionFactory) : | ||
BaseQuery<T> | ||
where T : IEntity | ||
{ | ||
public override async Task<Result<T>> ExecuteAsync() | ||
{ | ||
List<T> data = await fileConnectionFactory.LoadDataAsync(); | ||
Result<T> result = await Execute(data); | ||
|
||
if (!result.IsSuccess) | ||
return result.Errors; | ||
|
||
return result.Value; | ||
} | ||
|
||
protected abstract Task<Result<T>> Execute(IEnumerable<T> data); | ||
} |
Oops, something went wrong.