diff --git a/DigitalData.Core.Abstractions/Infrastructure/ICRUDRepository.cs b/DigitalData.Core.Abstractions/Infrastructure/ICRUDRepository.cs index c5562ff..a452a81 100644 --- a/DigitalData.Core.Abstractions/Infrastructure/ICRUDRepository.cs +++ b/DigitalData.Core.Abstractions/Infrastructure/ICRUDRepository.cs @@ -5,6 +5,7 @@ /// /// The type of the entity this repository works with. /// The type of the identifier for the entity. + [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 where TEntity : class, IUnique { /// diff --git a/DigitalData.Core.Abstractions/Infrastructure/IRepository.cs b/DigitalData.Core.Abstractions/Infrastructure/IRepository.cs new file mode 100644 index 0000000..fbd9581 --- /dev/null +++ b/DigitalData.Core.Abstractions/Infrastructure/IRepository.cs @@ -0,0 +1,16 @@ +using System.Linq.Expressions; + +namespace DigitalData.Core.Abstractions.Infrastructure; + +public interface IRepository +{ + public Task CreateAsync(TDto dto); + + public Task CreateAsync(IEnumerable dtos); + + public Task> ReadAsync(Expression? expression = null); + + public Task> UpdateAsync(TDto dto, Expression expression); + + public Task> DeleteAsync(Expression expression); +}