/// <inheritdoc/>
        public async Task ReportInfo()
        {
            var currentVersion = _versionProvider.GetCurrentVersion();
            var latestVersion  = await _versionProvider.GetLatestVersion();

            ReportEnvironmentalInfo(currentVersion);
            if (!latestVersion.Equals(currentVersion) && latestVersion.IsResolved)
            {
                ReportThatNewVersionIsAvailable(latestVersion);
            }
        }
示例#2
0
 /// <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);
     }
 }
示例#3
0
 public IActionResult Get()
 {
     try
     {
         return(new HttpOkObjectResult(_versionProvider.GetCurrentVersion()));
     }
     catch (Exception ex)
     {
         var error = new Error(ex.Message);
         return(new ObjectResult(error)
         {
             StatusCode = 500
         });
     }
 }