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:
@@ -5,6 +5,7 @@
|
||||
/// </summary>
|
||||
/// <typeparam name="TEntity">The type of the entity this repository works with.</typeparam>
|
||||
/// <typeparam name="TId">The type of the identifier for the entity.</typeparam>
|
||||
[Obsolete("ICRUDRepository has been deprecated. Please use the IRepository interface instead, which provides a better abtraction (e.g. without tracking) and flexibility.")]
|
||||
public interface ICRUDRepository<TEntity, TId> where TEntity : class, IUnique<TId>
|
||||
{
|
||||
/// <summary>
|
||||
|
||||
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