using AutoMapper;
using VentaUniformes.Application.Interfaces;
using VentaUniformes.Application.Persistencia.user.commands.UpdateUser;
using VentaUniformes.Domain.Entities.User;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace VentaUniformes.Application.Persistencia.user.Queries.GetAllUser
{
    public class GetAllUserQuery: IGetAllUserQuery
    {
        IPersistenciaService _persistenciaService;
        IMapper _mapper;
        public GetAllUserQuery(IPersistenciaService persistenciaService, IMapper mapper)
        {
            _persistenciaService = persistenciaService;
            _mapper = mapper;
        }
        public async Task<List<GetAllUserModel>> Execute()
        {
            var l = await _persistenciaService.GetAllUser();
            return _mapper.Map<List<GetAllUserModel>>(l); 
         }
    }
}
