using AutoMapper;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using VentaUniformes.Application.Interfaces;
using VentaUniformes.Application.Persistencia.user.Queries.GetAllUser;

namespace VentaUniformes.Application.Persistencia.Producto.Queries.GetAllProduct
{
    public class GetAllProductQuery : IGetAllProductQuery
    {
        IPersistenciaService _persistenciaService;
        IMapper _mapper;
        public GetAllProductQuery(IPersistenciaService persistenciaService, IMapper mapper)
        {
            _persistenciaService = persistenciaService;
            _mapper = mapper;
        }
        public async Task<List<GetAllProductModel>> Execute()
        {
            var l = await _persistenciaService.GetAllProduct();
            return _mapper.Map<List<GetAllProductModel>>(l);
        }
    }
}
