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

namespace VentaUniformes.Application.Persistencia.user.Queries.GetUserByPassAndName
{
    public class GetUserByPassAndNameQuery: IGetUserByPassAndNameQuery
    {
        IPersistenciaService _persistenciaService;
        IMapper _mapper;
        public GetUserByPassAndNameQuery(IPersistenciaService persistenciaService, IMapper mapper)
        {
            _persistenciaService = persistenciaService;
            _mapper = mapper;
        }
        public async Task<GetUserByPassAndNameModel> Execute(string pass, string name)
        {

            //aqui se guarda realmente
            var enty = await _persistenciaService.GetUserByPassAndName(pass, name);
            return _mapper.Map<GetUserByPassAndNameModel>(enty);
        }
    }
}
