19 lines
535 B
C#
19 lines
535 B
C#
using LiteCharms.Models;
|
|
|
|
namespace LiteCharms.Features.Products.Queries;
|
|
|
|
public class GetProductPricesQuery : IRequest<Result<ProductPrice[]>>
|
|
{
|
|
public int MaxRecords { get; set; }
|
|
|
|
private GetProductPricesQuery(int maxRecords = 1000) => MaxRecords = maxRecords;
|
|
|
|
public static GetProductPricesQuery Create(int maxRecords = 1000)
|
|
{
|
|
if (maxRecords <= 0)
|
|
throw new ArgumentOutOfRangeException(nameof(maxRecords), "MaxRecords must be greater than zero.");
|
|
|
|
return new(maxRecords);
|
|
}
|
|
}
|