Remove GetSingleBySpec

This commit is contained in:
Eric Fleming
2019-03-01 22:16:31 -05:00
parent 1ba52becaa
commit 1152f4a45d
2 changed files with 2 additions and 11 deletions

View File

@@ -5,6 +5,6 @@ namespace Microsoft.eShopWeb.ApplicationCore.Interfaces
{
public interface IRepository<T> where T : BaseEntity
{
T GetSingleBySpec(ISpecification<T> spec);
}
}

View File

@@ -21,11 +21,6 @@ namespace Microsoft.eShopWeb.Infrastructure.Data
_dbContext = dbContext;
}
public T GetSingleBySpec(ISpecification<T> spec)
{
return List(spec).FirstOrDefault();
}
public virtual async Task<T> GetByIdAsync(int id)
{
return await _dbContext.Set<T>().FindAsync(id);
@@ -36,10 +31,6 @@ namespace Microsoft.eShopWeb.Infrastructure.Data
return await _dbContext.Set<T>().ToListAsync();
}
public IEnumerable<T> List(ISpecification<T> spec)
{
return ApplySpecification(spec).AsEnumerable();
}
public async Task<IReadOnlyList<T>> ListAsync(ISpecification<T> spec)
{
return await ApplySpecification(spec).ToListAsync();