Ejemplo n.º 1
0
        public async Task Send(string message, string fromFile)
        {
            var pc = new PowerBIProducerCommands(CurrentContext, service);

            if (fromFile != null)
            {
                await pc.SendFromFile(fromFile);
            }
            else
            {
                await pc.Send(message);
            }
        }
Ejemplo n.º 2
0
        public async Task Stream(string fromFile, int delay, FileType fileFormat)
        {
            var pc = new PowerBIProducerCommands(CurrentContext, service);

            int timeBetweenMessages = 1000;

            if (delay > 0)
            {
                timeBetweenMessages = delay;
            }

            if (fileFormat == FileType.NDJSON)
            {
                await pc.StreamNDJSON(fromFile, timeBetweenMessages);
            }
            else
            {
                Console.WriteLine($"Invalid file format: {fileFormat}, expected ndjson");
                return;
            }
        }