public async Task <Unit> Handle(Command cmd, CancellationToken cancellationToken) { var user = await _storage.GetUser(cmd.UserId); if (user == null) { return(new Unit()); } user.Delete(cmd.Feedback); await _storage.Save(user); await _emails.Send( EmailSettings.Admin, Sender.NoReply, EmailTemplate.AdminUserDeleted, new { feedback = cmd.Feedback, email = user.State.Email }); await _storage.Delete(user); await _portfolio.Delete(user.Id); return(new Unit()); }
public async Task <Unit> Handle(Command cmd, CancellationToken cancellationToken) { var user = await _storage.GetUser(cmd.UserId); if (user == null) { return(new Unit()); } await _portfolio.Delete(user.Id); return(new Unit()); }