예제 #1
0
        public async Task Send(string message)
        {
            var config = service.LoadConfig();

            this.currentContext = config.PowerBIContexts[config.CurrentPowerBIContext];

            //await RunAsync(currentContext.ConnectionString, currentContext.EventHubName);
            try
            {
                var r = await HttpUtilities.PostAsync(currentContext.PushURL, message);

                r.EnsureSuccessStatusCode();
                Console.WriteLine($"Http post sent with message: {message}");
            }
            catch (Exception ex)
            {
                Console.WriteLine($"Error: {ex.Message}");
            }
        }
예제 #2
0
        public void SetContext(string name,
                               string pushUrl)
        {
            Console.WriteLine($"Setting context {name} with push url {pushUrl}");
            var            config = service.LoadConfig();
            PowerBIContext ctxt   = null;

            if (!config.PowerBIContexts.TryGetValue(name, out ctxt))
            {
                ctxt = new PowerBIContext();
            }


            if (pushUrl != null)
            {
                ctxt.PushURL = pushUrl;
            }

            config.PowerBIContexts[name.ToLower()] = ctxt;

            service.UpdateConfig(config);
        }
예제 #3
0
 public PowerBIProducerCommands(PowerBIContext context, ConfigService service)
 {
     this.currentContext = context;
     this.service        = service;
 }