16 lines
519 B
C#
16 lines
519 B
C#
|
|
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);
|
||
|
|
}
|
||
|
|
}
|