コード例 #1
0
        public RefreshReleaseRepositoryResults Execute()
        {
            var results = new RefreshReleaseRepositoryResults();

            var feedReleases = _releaseFeedProvider.GetAllCurrentReleases();

            var updateList = feedReleases.Select(x => new ReleasePersistencyItem { Name = x.Name, Scrapped = DateTime.UtcNow, Version = x.Version, Created = x.Created, IsAbsoluteLatestVersion = x.IsAbsoluteLatestVersion, IsPrerelease = x.IsPrerelease, IsLatestVersion = x.IsLatestVersion, ReleaseNotes = x.ReleaseNotes, IconUrl = x.IconUrl, Description = x.Description, Authors = x.Authors, DownloadCount = x.DownloadCount, VersionDownloadCount = x.VersionDownloadCount });
            var statisticsList = feedReleases.Select(x => new ReleasePersistencyStatisticsItem { DownloadCount = x.DownloadCount, Name = x.Name, Scrapped = DateTime.UtcNow, Version = x.Version, VersionDownloadCount = x.VersionDownloadCount });

            results.Results = updateList;

            results.ReleaseDetails = _releasePersistencyProvider.AddReleases(updateList);
            results.StatisticReleaseDetails = _releasePersistencyProvider.AddStatisticsReleases(statisticsList);
             
            return results;
        }
コード例 #2
0
        public RefreshReleaseRepositoryResults Execute()
        {
            var results = new RefreshReleaseRepositoryResults();

            var feedReleases = _releaseFeedProvider.GetAllCurrentReleases();

            var updateList = feedReleases.Select(x => new ReleasePersistencyItem {
                Name = x.Name, Scrapped = DateTime.UtcNow, Version = x.Version, Created = x.Created, IsAbsoluteLatestVersion = x.IsAbsoluteLatestVersion, IsPrerelease = x.IsPrerelease, IsLatestVersion = x.IsLatestVersion, ReleaseNotes = x.ReleaseNotes, IconUrl = x.IconUrl, Description = x.Description, Authors = x.Authors, DownloadCount = x.DownloadCount, VersionDownloadCount = x.VersionDownloadCount
            });
            var statisticsList = feedReleases.Select(x => new ReleasePersistencyStatisticsItem {
                DownloadCount = x.DownloadCount, Name = x.Name, Scrapped = DateTime.UtcNow, Version = x.Version, VersionDownloadCount = x.VersionDownloadCount
            });

            results.Results = updateList;

            results.ReleaseDetails          = _releasePersistencyProvider.AddReleases(updateList);
            results.StatisticReleaseDetails = _releasePersistencyProvider.AddStatisticsReleases(statisticsList);

            return(results);
        }