Exemplo n.º 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}");
            }
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
0
 public PowerBIProducerCommands(PowerBIContext context, ConfigService service)
 {
     this.currentContext = context;
     this.service        = service;
 }