19 lines
475 B
C#
19 lines
475 B
C#
using LiteCharms.Models;
|
|
|
|
namespace LiteCharms.Features.Products.Queries;
|
|
|
|
public class GetProductQuery : IRequest<Result<Product>>
|
|
{
|
|
public Guid ProductId { get; set; }
|
|
|
|
private GetProductQuery(Guid productId) => ProductId = productId;
|
|
|
|
public static GetProductQuery Create(Guid productId)
|
|
{
|
|
if(productId == Guid.Empty)
|
|
throw new ArgumentException("Product ID is required.", nameof(productId));
|
|
|
|
return new(productId);
|
|
}
|
|
}
|