Ablehnung von ICRUDRepository; Einführung der IRepository-Schnittstelle
Die `ICRUDRepository`-Schnittstelle wurde als veraltet markiert, was bedeutet, dass sie zugunsten der neuen `IRepository`-Schnittstelle abgelehnt wird. Die „IRepository“-Schnittstelle bietet eine verbesserte Abstraktion und Flexibilität, die Methoden zum Erstellen, Lesen, Aktualisieren und Löschen von Entitäten mit Unterstützung für asynchrone Operationen umfasst.
This commit is contained in:
16
DigitalData.Core.Abstractions/Infrastructure/IRepository.cs
Normal file
16
DigitalData.Core.Abstractions/Infrastructure/IRepository.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Linq.Expressions;
|
||||
|
||||
namespace DigitalData.Core.Abstractions.Infrastructure;
|
||||
|
||||
public interface IRepository<TEntity>
|
||||
{
|
||||
public Task<TEntity> CreateAsync<TDto>(TDto dto);
|
||||
|
||||
public Task<TEntity> CreateAsync<TDto>(IEnumerable<TDto> dtos);
|
||||
|
||||
public Task<IEnumerable<TEntity>> ReadAsync(Expression? expression = null);
|
||||
|
||||
public Task<IEnumerable<TEntity>> UpdateAsync<TDto>(TDto dto, Expression expression);
|
||||
|
||||
public Task<IEnumerable<TEntity>> DeleteAsync<TDto>(Expression expression);
|
||||
}
|
||||
Reference in New Issue
Block a user