private void DoWork(object state)
        {
            var data   = Guid.NewGuid().ToString();
            var base64 = _qrCodeService.CreateQRCode(data).Result;

            _logger.LogInformation($"Enviando um novo QR Code ...");
            _hubContext.Clients.All.SendAsync("SendTestebase64", base64);
        }
Exemple #2
0
        private async Task ExecuteQrCodeGenerator()
        {
            var data = Guid.NewGuid().ToString();

            using (var scope = _factory.CreateScope())
            {
                // var qrCodeService = scope.ServiceProvider.GetRequiredService<QrCodeService>();
                var base64 = _qrCodeService.CreateQRCode(data).Result;
                await _hubContext.Clients.All.SendAsync("SendTestebase64", base64);
            }
        }
        public IHttpActionResult Post([FromBody] QrCode qrCode)
        {
            QrCode newQrCode = qrCodeService.CreateQRCode(qrCode);

            return(Ok(qrCode));
        }