Пример #1
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 });
        }