Beispiel #1
0
        public ActionResult CreateUser(string name, string email)
        {
            var cmd = new CreateNewUserCmd {
                Name = "Shane", EmailAddress = "*****@*****.**"
            };

            ServiceBus.Bus.Send(cmd);
            return(this.Json(new { sent = cmd }));
        }
Beispiel #2
0
        // home/CreateUser?name=mark&[email protected]
        public ActionResult CreateUser(string name, string email)
        {
            var cmd = new CreateNewUserCmd
            {
                Name         = name,
                EmailAddress = email
            };

            ServiceBus.Bus.Send(cmd);
            return(Json(new { sent = cmd }));
        }
 public void Handle(CreateNewUserCmd message)
 {
     this.Data.Name             = message.Name;
     this.Data.EmailAddress     = message.EmailAddress;
     this.Data.VerificationCode = Guid.NewGuid().ToString("n").Substring(0, 4);
     Bus.Send(new SendVerificationEmailCmd
     {
         Name             = message.Name,
         EmailAddress     = message.EmailAddress,
         VerificationCode = Data.VerificationCode,
         IsReminder       = false
     });
 }
        public async Task <ActionResult> CreateUser(string name, string email)
        {
            var cmd = new CreateNewUserCmd
            {
                Name         = name,
                EmailAddress = email
            };

            var sendOptions = new SendOptions();

            sendOptions.SetDestination("UserService");

            //sendOptions.DelayDeliveryWith(TimeSpan.FromSeconds(10));
            await endpointInstance.Send(cmd, sendOptions).ConfigureAwait(false);

            return(Json(new { sent = cmd }));
        }