public void Save() { if (EntityType == ServiceBusEntityType.Queue) { _manager.CreateQueue(Path, Users); } else { _manager.CreateTopic(Path, Users); } }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); BundleConfig.RegisterBundles(BundleTable.Bundles); var instrumentationKey = ConfigurationManager.AppSettings["AppInsightsInstrumentationKey"]; if (!string.IsNullOrWhiteSpace(instrumentationKey)) { TelemetryConfiguration.Active.InstrumentationKey = instrumentationKey; } var serviceBusManager = new ServiceBusManager(ConfigurationManager.ConnectionStrings["AzureWebJobsServiceBus"].ConnectionString); serviceBusManager.CreateQueue(); }
private async Task CopyQueues(ProgressDialogController controller) { var queuesToUpdate = _fromManager.Queues.Where(a => _toManager.Queues.Select(b => b.Path).Contains(a.Path)).ToList(); foreach (var queue in queuesToUpdate) { controller.SetMessage(string.Format("Updating: {0}", queue.Path)); await Task.Run(() => { _toManager.UpdateQueue(queue); }); } var queuesToAdd = _fromManager.Queues.Except(_toManager.Queues, new LambdaComparer <QueueDescription>((a, b) => a.Path == b.Path, a => 1)).ToList(); foreach (var queue in queuesToAdd) { controller.SetMessage(string.Format("Adding: {0}", queue.Path)); await Task.Run(() => { _toManager.CreateQueue(queue); }); } }