Update Specification and other packages to latest version (#582)
* Updating repositories and specification version Need to fix broken tests * removing test that would just be testing mocked result now * Refactored from IAsyncRepository and removed it. Tests pass. * Update packages
This commit is contained in:
@@ -1,21 +0,0 @@
|
||||
using Ardalis.Specification;
|
||||
using Microsoft.eShopWeb.ApplicationCore.Entities;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces
|
||||
{
|
||||
public interface IAsyncRepository<T> where T : BaseEntity, IAggregateRoot
|
||||
{
|
||||
Task<T> GetByIdAsync(int id, CancellationToken cancellationToken = default);
|
||||
Task<IReadOnlyList<T>> ListAllAsync(CancellationToken cancellationToken = default);
|
||||
Task<IReadOnlyList<T>> ListAsync(ISpecification<T> spec, CancellationToken cancellationToken = default);
|
||||
Task<T> AddAsync(T entity, CancellationToken cancellationToken = default);
|
||||
Task UpdateAsync(T entity, CancellationToken cancellationToken = default);
|
||||
Task DeleteAsync(T entity, CancellationToken cancellationToken = default);
|
||||
Task<int> CountAsync(ISpecification<T> spec, CancellationToken cancellationToken = default);
|
||||
Task<T> FirstAsync(ISpecification<T> spec, CancellationToken cancellationToken = default);
|
||||
Task<T> FirstOrDefaultAsync(ISpecification<T> spec, CancellationToken cancellationToken = default);
|
||||
}
|
||||
}
|
||||
@@ -4,8 +4,8 @@ using System.Threading.Tasks;
|
||||
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces
|
||||
{
|
||||
|
||||
public interface IOrderRepository : IAsyncRepository<Order>
|
||||
{
|
||||
Task<Order> GetByIdWithItemsAsync(int id);
|
||||
}
|
||||
//public interface IOrderRepository : IAsyncRepository<Order>
|
||||
//{
|
||||
// Task<Order> GetByIdWithItemsAsync(int id);
|
||||
//}
|
||||
}
|
||||
|
||||
8
src/ApplicationCore/Interfaces/IReadRepository.cs
Normal file
8
src/ApplicationCore/Interfaces/IReadRepository.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Ardalis.Specification;
|
||||
|
||||
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces
|
||||
{
|
||||
public interface IReadRepository<T> : IReadRepositoryBase<T> where T : class, IAggregateRoot
|
||||
{
|
||||
}
|
||||
}
|
||||
8
src/ApplicationCore/Interfaces/IRepository.cs
Normal file
8
src/ApplicationCore/Interfaces/IRepository.cs
Normal file
@@ -0,0 +1,8 @@
|
||||
using Ardalis.Specification;
|
||||
|
||||
namespace Microsoft.eShopWeb.ApplicationCore.Interfaces
|
||||
{
|
||||
public interface IRepository<T> : IRepositoryBase<T> where T : class, IAggregateRoot
|
||||
{
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user