18 lines
1.3 KiB
C#
18 lines
1.3 KiB
C#
using HardwarePerformance.Models;
|
|
|
|
namespace HardwarePerformance.Repositories
|
|
{
|
|
public interface IProductRepository : IRepository<Product>
|
|
{
|
|
Task<IEnumerable<Product>> GetByCategoryAsync(int categoryId);
|
|
Task<IEnumerable<Product>> GetByCategoryAsync(int categoryId, int page, int pageSize, string sortBy = "CurrentRank", string sortOrder = "asc");
|
|
Task<IEnumerable<Product>> SearchAsync(string query);
|
|
Task<IEnumerable<Product>> SearchAsync(string query, int? categoryId = null, string? manufacturer = null, int? minScore = null, int? maxScore = null, int page = 1, int pageSize = 20);
|
|
Task<IEnumerable<Product>> FilterAsync(int? categoryId, string? manufacturer, int? minScore, int? maxScore, int? year);
|
|
Task<IEnumerable<Product>> FilterAsync(int? categoryId, string? manufacturer, int? minScore, int? maxScore, int? year, int page, int pageSize, string sortBy = "CurrentRank", string sortOrder = "asc");
|
|
Task<int> CountAsync(int? categoryId = null);
|
|
Task<int> CountSearchResultsAsync(string query, int? categoryId = null, string? manufacturer = null, int? minScore = null, int? maxScore = null);
|
|
Task<int> CountFilterResultsAsync(int? categoryId, string? manufacturer, int? minScore, int? maxScore, int? year);
|
|
Task<Category?> GetCategoryByProductIdAsync(int productId);
|
|
}
|
|
} |