diff --git a/DigitalData.Core.Infrastructure/CRUDRepository.cs b/DigitalData.Core.Infrastructure/CRUDRepository.cs index 3724cf3..6162bf5 100644 --- a/DigitalData.Core.Infrastructure/CRUDRepository.cs +++ b/DigitalData.Core.Infrastructure/CRUDRepository.cs @@ -1,4 +1,5 @@ using DigitalData.Core.Abstractions; +using DigitalData.Core.Application; using DigitalData.Core.Application.Interfaces.Repository; using Microsoft.EntityFrameworkCore; @@ -15,7 +16,7 @@ namespace DigitalData.Core.Infrastructure /// It leverages the EF Core's DbContext and DbSet to perform these operations. /// public class CRUDRepository : ICRUDRepository - where TEntity : class, IUnique + where TEntity : class where TDbContext : DbContext { protected readonly TDbContext _dbContext; @@ -107,6 +108,6 @@ namespace DigitalData.Core.Infrastructure /// If there are multiple entities with the same identifier, they will all be counted. /// The default implementation assumes that the identifier is unique for each entity. /// - public virtual async Task CountAsync(TId id) => await _dbSet.Where(e => e.Id!.Equals(id)).CountAsync(); + public virtual async Task CountAsync(TId id) => await _dbSet.Where(e => e.GetId().Equals(id)).CountAsync(); } } \ No newline at end of file