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.Reflection;
using System.Text;
using System.Threading.Tasks;

namespace VentaUniformes.Application.Persistencia.user.Queries.GetUserById
{
    public class GetUserByIdQuery: IGetUserByIdQuery
    {
        IPersistenciaService _persistenciaService;
        IMapper _mapper;
        public GetUserByIdQuery(IPersistenciaService persistenciaService, IMapper mapper)
        {
            _persistenciaService = persistenciaService;
            _mapper = mapper;
        }
        public async Task<GetUserByIdModel> Execute(int id)
        {
            
            //aqui se guarda realmente
            var enty= await _persistenciaService.GetUserById(id);
            return _mapper.Map<GetUserByIdModel>(enty);
        }
    }
}
