-
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.
feat(application): add transport table concrete and base class for it
- Loading branch information
1 parent
9391584
commit 908ab93
Showing
2 changed files
with
50 additions
and
0 deletions.
There are no files selected for viewing
34 changes: 34 additions & 0 deletions
34
src/DistributionCenter.Application/Tables/Core/Bases/BaseJsonTable.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,34 @@ | ||
namespace DistributionCenter.Application.Tables.Core.Bases; | ||
|
||
using Components.Information.Interfaces; | ||
using Components.QueryCommands.Concretes.File.Concretes; | ||
using Components.QueryCommands.Interfaces; | ||
using Connections.Interfaces; | ||
using Domain.Entities.Interfaces; | ||
using Interfaces; | ||
|
||
public abstract class BaseJsonTable<T>(IFileConnectionFactory<T> fileConnectionFactory) : ITable<T> | ||
where T : IEntity | ||
{ | ||
protected IFileConnectionFactory<T> FileConnectionFactory { get; } = fileConnectionFactory; | ||
|
||
public IQuery<T> GetById(Guid id) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public ICommand Create(T entity) | ||
{ | ||
return new CreateJsonCommand<T>( | ||
FileConnectionFactory, | ||
entity); | ||
} | ||
|
||
public ICommand Update(T entity) | ||
{ | ||
throw new NotImplementedException(); | ||
} | ||
|
||
public abstract ITableInformation GetInformation(); | ||
} | ||
|
16 changes: 16 additions & 0 deletions
16
src/DistributionCenter.Application/Tables/Core/Concretes/TransportTable.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 @@ | ||
namespace DistributionCenter.Application.Tables.Core.Concretes; | ||
|
||
using Components.Information.Concretes; | ||
using Components.Information.Interfaces; | ||
using Connections.Interfaces; | ||
using Bases; | ||
using DistributionCenter.Domain.Entities.Concretes; | ||
|
||
public class TransportTable(IFileConnectionFactory<Transport> fileConnectionFactory) : | ||
BaseJsonTable<Transport>(fileConnectionFactory) | ||
{ | ||
public override ITableInformation GetInformation() | ||
{ | ||
return new TransportTableInformation(); | ||
} | ||
} |