Files
components/LiteCharms.Features/Products/Queries/GetProductsQuery.cs
T
2026-05-05 14:36:46 +02:00

19 lines
486 B
C#

using LiteCharms.Models;
namespace LiteCharms.Features.Products.Queries;
public class GetProductsQuery : IRequest<Result<Product[]>>
{
public int MaxRecords { get; set; }
private GetProductsQuery(int maxRecords = 1000) => MaxRecords = maxRecords;
public static GetProductsQuery Create(int maxRecords = 1000)
{
if (maxRecords <= 0)
throw new ArgumentException("MaxRecords must be a positive integer.");
return new(maxRecords);
}
}