/// <summary>
        /// Finds device authorization by device code.
        /// </summary>
        /// <param name="deviceCode">The device code.</param>
        /// <returns></returns>
        public Task <DeviceCode> FindByDeviceCodeAsync(string deviceCode)
        {
            var deviceFlowCodes = DeviceCodes.FindByDeviceCode(deviceCode);
            var model           = ToModel(deviceFlowCodes?.Data);

            _logger.LogDebug("{deviceCode} found in database: {deviceCodeFound}", deviceCode, model != null);

            return(Task.FromResult(model));
        }
        /// <summary>
        /// Removes the device authorization, searching by device code.
        /// </summary>
        /// <param name="deviceCode">The device code.</param>
        /// <returns></returns>
        public Task RemoveByDeviceCodeAsync(string deviceCode)
        {
            var deviceFlowCodes = DeviceCodes.FindByDeviceCode(deviceCode);

            if (deviceFlowCodes != null)
            {
                _logger.LogDebug("removing {deviceCode} device code from database", deviceCode);

                try
                {
                    deviceFlowCodes.Delete();
                }
                catch (Exception ex)
                {
                    _logger.LogInformation("exception removing {deviceCode} device code from database: {error}", deviceCode, ex.Message);
                }
            }
            else
            {
                _logger.LogDebug("no {deviceCode} device code found in database", deviceCode);
            }

            return(Task.FromResult(0));
        }