using AutoMapper; using Mqtt.App.Application.Interfaces; using Mqtt.App.Application.Persistencia.user.commands.CreateUser; using Mqtt.App.Domain.Entities.User; using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace Mqtt.App.Application.Persistencia.user.commands.UpdateUser { public class UpdateUserCommand : IupdateUserCommand { IPersistenciaService _persistenciaService; IMapper _mapper; public UpdateUserCommand(IPersistenciaService persistenciaService, IMapper mapper) { _persistenciaService = persistenciaService; _mapper = mapper; } public async Task Execute(UpdateUserModel model) { var entity = _mapper.Map(model); //aqui se guarda realmente await _persistenciaService.UpdateUser(entity); return model; } } }