static void Main(string[] args) { try { m_StorageAcct = GetCloudStorageAccount(); //CloudTable table = ObtainTableCreatIfNotExist("customers"); CloudTable table = ObtainTableCreatIfNotExist("orders"); OrderEntity newOrder = new OrderEntity("George", "20150502"); newOrder.OrderNumber = "1"; newOrder.ShippedDate = Convert.ToDateTime("5/2/2015"); newOrder.RequiredDate = Convert.ToDateTime("5/10/2015"); newOrder.Status = "shipped"; TableOperation insertOperation = TableOperation.Insert(newOrder); table.Execute(insertOperation); } catch (StorageException ex) { if (ex.Message.Contains("409")) { Console.WriteLine("Caught exception:\n Likely RowKey already exists on insert.\n ex = {0}", ex); } } catch (Exception ex) { Console.WriteLine("Caught exception: ex = {0}", ex); } ConsoleNTraceHelpers.PauseTillUserPressesEnterExitOnX(); }
public static void Main(string[] args) { Console.Title = m_ThisName; Console.WriteLine("{0}.Main(): Press <ENTER> to enqueue one", m_ThisName); Console.WriteLine(" test message to SB queue '{0}' via WCF NetMessagingBinding", ConstsNEnums.IngestionQueueName); InitSourceIds(args); while (true) { string userInput = ConsoleNTraceHelpers.PauseTillUserPressesEnterExitOnX(); if (userInput.ToLower() == "x") { break; } try { // Assume the queue exists, having been previously provisioned in Azure Portal. Console.WriteLine("{0}.Main(): Enqueueing test message..", m_ThisName); TestMessage msg = MakeTestMessage(++m_MsgSeqNumber, m_SourceId, m_SourceGroupId); IngestTestData(msg, ConstsNEnums.IngestionQueueEndpointName); } catch (Exception ex) { Console.WriteLine("{0}.Main(): IngestTestData() proxy threw exception\n {1}.", m_ThisName, ex); } } }