测试
This commit is contained in:
16
MinimalAPI/Repositories/IRepository.cs
Normal file
16
MinimalAPI/Repositories/IRepository.cs
Normal file
@@ -0,0 +1,16 @@
|
||||
using System.Linq.Expressions;
|
||||
using HardwarePerformance.Models;
|
||||
|
||||
namespace HardwarePerformance.Repositories
|
||||
{
|
||||
public interface IRepository<T> where T : class
|
||||
{
|
||||
Task<T?> GetByIdAsync(int id);
|
||||
Task<IEnumerable<T>> GetAllAsync();
|
||||
Task<IEnumerable<T>> FindAsync(Expression<Func<T, bool>> predicate);
|
||||
Task<T> AddAsync(T entity);
|
||||
Task UpdateAsync(T entity);
|
||||
Task DeleteAsync(T entity);
|
||||
Task<int> CountAsync(Expression<Func<T, bool>>? predicate = null);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user