diff --git a/src/ApplicationCore/Interfaces/IRepository.cs b/src/ApplicationCore/Interfaces/IRepository.cs index c9414d1..b4e475e 100644 --- a/src/ApplicationCore/Interfaces/IRepository.cs +++ b/src/ApplicationCore/Interfaces/IRepository.cs @@ -5,6 +5,6 @@ namespace Microsoft.eShopWeb.ApplicationCore.Interfaces { public interface IRepository where T : BaseEntity { - T GetSingleBySpec(ISpecification spec); + } } diff --git a/src/Infrastructure/Data/EfRepository.cs b/src/Infrastructure/Data/EfRepository.cs index 45f1ac5..6db7096 100644 --- a/src/Infrastructure/Data/EfRepository.cs +++ b/src/Infrastructure/Data/EfRepository.cs @@ -20,12 +20,7 @@ namespace Microsoft.eShopWeb.Infrastructure.Data { _dbContext = dbContext; } - - public T GetSingleBySpec(ISpecification spec) - { - return List(spec).FirstOrDefault(); - } - + public virtual async Task GetByIdAsync(int id) { return await _dbContext.Set().FindAsync(id); @@ -36,10 +31,6 @@ namespace Microsoft.eShopWeb.Infrastructure.Data return await _dbContext.Set().ToListAsync(); } - public IEnumerable List(ISpecification spec) - { - return ApplySpecification(spec).AsEnumerable(); - } public async Task> ListAsync(ISpecification spec) { return await ApplySpecification(spec).ToListAsync();