Пример #1
0
        public async Task <IActionResult> Geolocation(CreateGeoLocationModel model)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(GetModelErrors(ModelState)));
            }

            try
            {
                var result = await renderer.RenderAsync(QrCodeType.Geolocation, model);

                if (result == null)
                {
                    throw new Exception(StandardErrorMessages.Requests.UnableToRenderQrCode);
                }

                return(await HandleAsync(result, QrCodeType.Geolocation, model));
            }
            catch (Exception e)
            {
                Log.Error(e.Message);

                return(StatusCode(500));
            }
        }
Пример #2
0
        private async Task <QRCodeData> GenerateGeolocationQrCode(CreateGeoLocationModel model)
        {
            var geolocation = new Geolocation(model.Latitude, model.Longitude, model.Encoding);

            return(await GenerateAsync(geolocation));
        }