/// <inheritdoc/> public async Task ReportInfo() { var currentVersion = _versionProvider.GetCurrentVersion(); var latestVersion = await _versionProvider.GetLatestVersion(); ReportEnvironmentalInfo(currentVersion); if (!latestVersion.Equals(currentVersion) && latestVersion.IsResolved) { ReportThatNewVersionIsAvailable(latestVersion); } }
/// <inheritdoc/> public VersionInfo GetCurrentVersion() { try { return(_versionProvider.GetCurrentVersion()); } catch (Exception ex) { _logger.Error("Failed to retrieve information about the current version", ex); return(VersionInfo.UnResolved); } }
public IActionResult Get() { try { return(new HttpOkObjectResult(_versionProvider.GetCurrentVersion())); } catch (Exception ex) { var error = new Error(ex.Message); return(new ObjectResult(error) { StatusCode = 500 }); } }