コード例 #1
0
ファイル: Delete.cs プロジェクト: DT021/stock-analysis
            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());
            }
コード例 #2
0
            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());
            }