Skip to content

Open-source eCommerce platform for C# and ASP.NET Core 10 with MongoDB. Build multi-store shops and multi-vendor marketplaces with B2B/B2C, REST API, plugins, Vue 3 and Docker.

707 B
Raw Blame
using Grand.Business.Core.Queries.Catalog;
using Grand.Data;
using Grand.Domain.Catalog;
using Grand.Mediator;

namespace Grand.Business.Catalog.Queries.Handlers;

public class GetProductArchByIdQueryHandler : IRequestHandler<GetProductArchByIdQuery, Product>
{
    private readonly IRepository<ProductDeleted> _productDeletedRepository;

    public GetProductArchByIdQueryHandler(IRepository<ProductDeleted> productDeletedRepository)
    {
        _productDeletedRepository = productDeletedRepository;
    }

    public async Task<Product> Handle(GetProductArchByIdQuery request, CancellationToken cancellationToken)
    {
        return await _productDeletedRepository.GetByIdAsync(request.Id);
    }
}