public ActionResult Register(RegisterModel model)
        {
            AzureQueue<UserRegistrationMessage> queue = new AzureQueue<UserRegistrationMessage>(account);
            queue.AddMessage(new UserRegistrationMessage
            {
                DateOfBirth = model.DateOfBirth,
                Email = model.Email,
                FirstName = model.FirstName,
                LastName = model.LastName,
                RegistratoinId = model.RegistrationId,
            });

            return new EmptyResult();
        }
예제 #2
0
        public ActionResult Register(RegisterModel model)
        {
            AzureQueue<UserRegistrationMessage> queue = new AzureQueue<UserRegistrationMessage>(account);
            AzureBlobContainer<RegistrationTokenEntity> registrationBlob = new AzureBlobContainer<RegistrationTokenEntity>(account, true);

            var containerId = Guid.NewGuid().ToString();
            registrationBlob.Save(containerId, new RegistrationTokenEntity
            {
                RegistrationToken = null,
            });
            var blobContainer = registrationBlob.GetSharedAccessSignature(containerId, DateTime.Now.AddHours(1));

            queue.AddMessage(new UserRegistrationMessage
            {
                DateOfBirth = model.DateOfBirth,
                Email = model.Email,
                FirstName = model.FirstName,
                LastName = model.LastName,
                ContainerId = containerId,
            });

            return Json(new { container = blobContainer });
        }