Пример #1
0
        public async Task <IActionResult> InviteUsers(InvitationModel data)
        {
            // Do the critical path work: actually get
            // the users/emails into the system.
            await InsertUsersIntoDatabase(data.EmailList);

            // Then queue the non-critical path work
            // in a separate async-job: email
            // invitations will be sent to each user.
            // This also makes the job of sending
            // emails fault tolerant in case of
            // temporary errors while sending a message.
            Guid runId = await jobs.SendPendingInvitations();

            return(View("Results", new RunResultsModel
            {
                RunId = runId
            }));
        }