/// <summary>
        /// Returns the view with an updated model in the event of a storage error.
        /// </summary>
        /// <param name="row">The maps row key.</param>
        /// <param name="partition">The maps partition.</param>
        /// <param name="error">The storage error.</param>
        /// <returns>An updated view.</returns>
        protected ActionResult AzureStorageErrorResponse(string row, string partition, StorageException error)
        {
            Guard.NotNullOrEmpty(() => row);
            Guard.NotNullOrEmpty(() => partition);
            Guard.NotNull(() => error);

            ViewBag.Alerts = AlertModel.CreateSingle(AlertType.Danger, error.Message);

            var entityTask = TableStorage.Get(partition, row);

            Task.WaitAll(entityTask);

            return(this.View(entityTask.Result));
        }
Пример #2
0
        public void GetConvertable()
        {
            var data = new MessageData(Guid.NewGuid());

            data.Fill();

            var table = new AzureTable <MessageData>(CloudStorageAccount.DevelopmentStorageAccount);

            table.AddEntity(data);
            var msg = table.Get <MessageDisplay, MessageData>(data.PartitionKey, data.RowKey);

            Assert.AreEqual <Guid>(data.Id, msg.Identifier);
            Assert.AreEqual <Guid>(data.ApplicationId, msg.Token.ApplicationId);
            Assert.AreEqual <string>(data.MachineName, msg.MachineName);
        }
Пример #3
0
 public void GetConvertableRowKeyInvalid()
 {
     var table = new AzureTable <MessageData>(CloudStorageAccount.DevelopmentStorageAccount);
     var msg   = table.Get <MessageDisplay, MessageData>(StringHelper.ValidString(), StringHelper.NullEmptyWhiteSpace());
 }
Пример #4
0
 public void GetConvertablePartitionKeyInvalid()
 {
     var table = new AzureTable <MessageData>(CloudStorageAccount.DevelopmentStorageAccount);
     var msg   = table.Get <MessageDisplay, MessageData>(null, StringHelper.ValidString());
 }