From 9ea2b055c43b695a280bd3cc6249617979c3a742 Mon Sep 17 00:00:00 2001 From: Robin Dittrich Date: Tue, 24 Mar 2026 16:21:33 +0100 Subject: [PATCH 01/44] Update to dotnet 10, fix namespaces and code consistency --- Dockerfile | 4 +-- global.json | 2 +- .../BaGetter.Protocol.Samples.Tests.csproj | 2 +- .../Sample03_Metadata.cs | 5 ++-- .../BaGetterWebApplication.csproj | 2 +- samples/BaGetterWebApplication/Program.cs | 8 +++--- .../AliyunApplicationExtensions.cs | 6 +++-- src/BaGetter.Aliyun/AliyunStorageService.cs | 2 +- src/BaGetter.Aliyun/BaGetter.Aliyun.csproj | 2 +- src/BaGetter.Aws/AwsApplicationExtensions.cs | 6 +++-- src/BaGetter.Aws/BaGetter.Aws.csproj | 3 +-- src/BaGetter.Aws/S3StorageOptions.cs | 2 +- src/BaGetter.Aws/S3StorageService.cs | 2 +- .../AzureApplicationExtensions.cs | 10 ++++++-- src/BaGetter.Azure/BaGetter.Azure.csproj | 3 +-- .../Configuration/AzureBlobStorageOptions.cs | 4 +-- .../Configuration/AzureSearchOptions.cs | 2 +- .../Configuration/AzureTableOptions.cs | 2 +- .../Extensions/StorageExceptionExtensions.cs | 4 +-- .../Storage/BlobStorageService.cs | 6 +++-- src/BaGetter.Azure/Table/PackageEntity.cs | 4 +-- .../Table/PackageEntityExtensions.cs | 4 +-- .../Table/TableOperationBuilder.cs | 4 +-- .../Table/TablePackageDatabase.cs | 5 +++- .../Table/TableSearchService.cs | 7 ++++-- .../ApiKeyAuthenticationService.cs | 2 +- .../Authentication/AuthenticationConstants.cs | 8 +----- .../Authentication/IAuthenticationService.cs | 2 +- src/BaGetter.Core/BaGetter.Core.csproj | 2 +- src/BaGetter.Core/Configuration/ApiKey.cs | 6 ----- .../Configuration/BaGetterOptions.cs | 3 +-- .../Configuration/BindOptions.cs | 2 +- .../Configuration/DatabaseOptions.cs | 2 +- .../Configuration/FileSystemStorageOptions.cs | 2 +- .../Configuration/HealthCheckOptions.cs | 2 +- .../MirrorAuthenticationOptions.cs | 2 +- .../Configuration/MirrorAuthenticationType.cs | 2 +- .../Configuration/MirrorOptions.cs | 2 +- .../NugetAuthenticationOptions.cs | 4 +-- .../Configuration/NugetCredentials.cs | 2 +- .../Configuration/PackageDeletionBehavior.cs | 2 +- .../Configuration/PackageOverwriteAllowed.cs | 2 +- .../Configuration/RetentionOptions.cs | 2 +- .../Configuration/SearchOptions.cs | 2 +- .../Configuration/StatisticsOptions.cs | 2 +- .../Configuration/StorageOptions.cs | 2 +- .../Content/DefaultPackageContentService.cs | 3 ++- .../Content/IPackageContentService.cs | 2 +- src/BaGetter.Core/Entities/AbstractContext.cs | 3 ++- .../Converters/StringArrayComparer.cs | 2 +- .../Converters/StringArrayToJsonConverter.cs | 2 +- .../Converters/UriToStringConverter.cs | 2 +- src/BaGetter.Core/Entities/IContext.cs | 2 +- src/BaGetter.Core/Entities/NullContext.cs | 2 +- src/BaGetter.Core/Entities/Package.cs | 2 +- .../Entities/PackageDependency.cs | 2 +- src/BaGetter.Core/Entities/PackageType.cs | 2 +- src/BaGetter.Core/Entities/SemVerLevel.cs | 2 +- src/BaGetter.Core/Entities/TargetFramework.cs | 2 +- .../BaGetterApplicationExtensions.cs | 6 +++-- ...DependencyInjectionExtensions.Providers.cs | 5 +++- .../DependencyInjectionExtensions.cs | 14 ++++++++++- .../Extensions/HealthCheckExtensions.cs | 1 + src/BaGetter.Core/Extensions/IProvider.cs | 2 +- .../PackageArchiveReaderExtensions.cs | 3 ++- .../Extensions/StreamExtensions.cs | 3 +-- src/BaGetter.Core/Extensions/SystemTime.cs | 2 +- src/BaGetter.Core/IPackageDatabase.cs | 2 ++ src/BaGetter.Core/IPackageService.cs | 2 ++ .../Indexing/FrameworkCompatibilityService.cs | 2 +- .../IFrameworkCompatibilityService.cs | 2 +- .../Indexing/IPackageDeletionService.cs | 3 ++- .../Indexing/IPackageIndexingService.cs | 2 +- .../Indexing/ISymbolIndexingService.cs | 2 +- .../Indexing/PackageDeletionService.cs | 5 +++- .../Indexing/PackageIndexingService.cs | 7 +++++- .../Indexing/SymbolIndexingService.cs | 4 ++- .../BaGetRegistrationIndexPageItem.cs | 2 +- .../Metadata/BaGetterPackageMetadata.cs | 2 +- .../Metadata/BaGetterRegistrationIndexPage.cs | 2 +- .../BaGetterRegistrationIndexResponse.cs | 2 +- .../Metadata/DefaultPackageMetadataService.cs | 2 +- .../Metadata/IPackageMetadataService.cs | 2 +- .../Metadata/PackageRegistration.cs | 3 ++- .../Metadata/RegistrationBuilder.cs | 3 ++- src/BaGetter.Core/PackageDatabase.cs | 1 + src/BaGetter.Core/PackageService.cs | 3 +++ .../Search/AutocompleteRequest.cs | 2 +- .../Search/DatabaseSearchService.cs | 5 +++- .../Search/DependentsResponse.cs | 2 +- src/BaGetter.Core/Search/ISearchIndexer.cs | 3 ++- .../Search/ISearchResponseBuilder.cs | 3 ++- src/BaGetter.Core/Search/ISearchService.cs | 2 +- src/BaGetter.Core/Search/NullSearchIndexer.cs | 3 ++- src/BaGetter.Core/Search/NullSearchService.cs | 2 +- src/BaGetter.Core/Search/SearchRequest.cs | 2 +- .../Search/SearchResponseBuilder.cs | 3 ++- src/BaGetter.Core/Search/VersionsRequest.cs | 2 +- .../ServiceIndex/BaGetterServiceIndex.cs | 2 +- .../ServiceIndex/IServiceIndexService.cs | 2 +- .../Statistics/StatisticsService.cs | 2 ++ .../Storage/FileStorageService.cs | 4 ++- .../Storage/IPackageStorageService.cs | 3 ++- src/BaGetter.Core/Storage/IStorageService.cs | 2 +- .../Storage/ISymbolStorageService.cs | 2 +- .../Storage/NullStorageService.cs | 2 +- .../Storage/PackageStorageService.cs | 3 ++- .../Storage/SymbolStorageService.cs | 2 +- .../Clients/DisabledUpstreamClient.cs | 3 ++- .../Upstream/Clients/V2UpstreamClient.cs | 4 ++- .../Upstream/Clients/V3UpstreamClient.cs | 5 +++- .../Upstream/DownloadsImporter.cs | 3 ++- .../Upstream/IPackageDownloadsSource.cs | 2 +- src/BaGetter.Core/Upstream/IUpstreamClient.cs | 7 +++--- .../Upstream/PackageDownloadsJsonSource.cs | 2 +- .../Validation/RequiredIfAttribute.cs | 2 +- .../Validation/ValidateBaGetOptions.cs | 2 +- .../Validation/ValidateStartupOptions.cs | 3 ++- .../BaGetter.Database.MySql.csproj | 2 +- .../MySqlApplicationExtensions.cs | 5 ++-- src/BaGetter.Database.MySql/MySqlContext.cs | 3 ++- .../BaGetter.Database.PostgreSql.csproj | 2 +- .../PostgreSqlApplicationExtensions.cs | 5 ++-- .../PostgreSqlContext.cs | 3 ++- .../BaGetter.Database.SqlServer.csproj | 2 +- .../SqlServerApplicationExtensions.cs | 5 ++-- .../SqlServerContext.cs | 3 ++- .../BaGetter.Database.Sqlite.csproj | 2 +- .../SqliteApplicationExtensions.cs | 5 ++-- src/BaGetter.Database.Sqlite/SqliteContext.cs | 3 ++- src/BaGetter.Gcp/BaGetter.Gcp.csproj | 2 +- .../GoogleCloudApplicationExtensions.cs | 6 +++-- src/BaGetter.Gcp/GoogleCloudStorageOptions.cs | 2 +- src/BaGetter.Gcp/GoogleCloudStorageService.cs | 3 +-- .../BaGetter.Protocol.csproj | 2 +- .../Catalog/CatalogClient.cs | 2 ++ .../Catalog/CatalogProcessor.cs | 4 +-- .../Catalog/ICatalogClient.cs | 2 +- .../Catalog/NullCatalogClient.cs | 2 +- .../Catalog/RawCatalogClient.cs | 3 ++- .../PackageDependencyRangeJsonConverter.cs | 2 +- .../StringOrStringArrayJsonConverter.cs | 2 +- .../Extensions/CatalogModelExtensions.cs | 2 +- .../Extensions/HttpClientExtensions.cs | 2 +- .../NuGetClientFactoryExtensions.cs | 2 +- .../PackageContentModelExtensions.cs | 2 +- .../PackageMetadataModelExtensions.cs | 6 ++--- .../Extensions/SearchModelExtensions.cs | 2 +- .../Extensions/ServiceIndexModelExtensions.cs | 2 +- .../Models/DependencyItem.cs | 2 +- .../Models/PackageMetadata.cs | 2 +- src/BaGetter.Protocol/Models/SearchResult.cs | 2 +- src/BaGetter.Protocol/NuGetClient.cs | 14 +++++++---- src/BaGetter.Protocol/NuGetClientFactory.cs | 7 +++++- .../PackageContent/IPackageContentClient.cs | 2 +- .../PackageContent/PackageContentClient.cs | 2 ++ .../PackageContent/RawPackageContentClient.cs | 3 ++- .../PackageMetadata/IPackageMetadataClient.cs | 2 +- .../PackageMetadata/PackageMetadataClient.cs | 2 ++ .../RawPackageMetadataClient.cs | 3 ++- .../Search/AutocompleteClient.cs | 2 ++ .../Search/IAutocompleteClient.cs | 2 +- src/BaGetter.Protocol/Search/ISearchClient.cs | 2 +- .../Search/NullAutocompleteClient.cs | 2 +- .../Search/RawAutocompleteClient.cs | 3 ++- .../Search/RawSearchClient.cs | 3 ++- src/BaGetter.Protocol/Search/SearchClient.cs | 2 ++ .../ServiceIndex/IServiceIndexClient.cs | 2 +- .../ServiceIndex/RawServiceIndexClient.cs | 3 ++- .../ServiceIndex/ServiceIndexClient.cs | 2 ++ src/BaGetter.Tencent/BaGetter.Tencent.csproj | 2 +- .../TencentApplicationExtensions.cs | 3 +++ src/BaGetter.Tencent/TencentStorageService.cs | 2 +- .../NugetBasicAuthenticationHandler.cs | 2 +- src/BaGetter.Web/BaGetter.Web.csproj | 4 +-- src/BaGetter.Web/BaGetterEndpointBuilder.cs | 3 +-- .../Controllers/PackageContentController.cs | 6 ++--- .../Controllers/PackageMetadataController.cs | 6 ++--- .../Controllers/PackagePublishController.cs | 6 ++++- .../Controllers/SearchController.cs | 6 ++--- .../Controllers/ServiceIndexController.cs | 6 ++--- .../Controllers/SymbolController.cs | 9 ++++--- .../Extensions/HttpRequestExtensions.cs | 4 +-- .../IApplicationBuilderExtensions.cs | 2 +- .../Extensions/IHostExtensions.cs | 5 +++- .../IServiceCollectionExtensions.cs | 8 +++--- .../Extensions/RazorExtensions.cs | 2 +- src/BaGetter.Web/Pages/Index.cshtml | 20 ++++++++------- src/BaGetter.Web/Pages/Index.cshtml.cs | 4 +-- src/BaGetter.Web/Pages/Package.cshtml | 25 +++++++++++-------- src/BaGetter.Web/Pages/Package.cshtml.cs | 5 +++- src/BaGetter.Web/Pages/Shared/_Layout.cshtml | 2 +- src/BaGetter.Web/Pages/Statistics.cshtml | 1 + src/BaGetter.Web/Pages/Statistics.cshtml.cs | 4 +-- src/BaGetter.Web/Pages/Upload.cshtml | 9 ++++--- src/BaGetter.Web/Pages/_ViewImports.cshtml | 6 +---- src/BaGetter/BaGetter.csproj | 2 +- src/BaGetter/ConfigureBaGetterServer.cs | 2 +- src/BaGetter/IServiceCollectionExtensions.cs | 3 +-- src/BaGetter/Program.cs | 4 +-- src/BaGetter/Startup.cs | 18 +++++++++---- src/BaGetter/ValidateBaGetterOptions.cs | 6 +---- .../BaGetter.Core.Tests.csproj | 2 +- .../DefaultPackageMetadataServiceTests.cs | 2 ++ .../Metadata/ModelTests.cs | 1 + .../Metadata/PackageRegistrationTests.cs | 2 ++ .../Metadata/RegistrationBuilderTests.cs | 2 ++ .../Search/DatabaseSearchServiceTests.cs | 3 +++ .../Search/SearchResponseBuilderTests.cs | 4 +++ .../Services/FileStorageServiceTests.cs | 2 ++ .../Services/PackageDatabaseTests.cs | 1 + .../Services/PackageDeletionServiceTests.cs | 4 +++ .../PackageIndexingServiceInMemoryTests.cs | 8 +++++- .../Services/PackageIndexingServiceTests.cs | 7 +++++- .../Services/PackageServiceTests.cs | 13 ++++++---- .../Services/PackageStorageServiceTests.cs | 2 ++ .../BaGetter.Core.Tests/Support/Generator.cs | 2 ++ .../Support/InMemoryPackageDatabase.cs | 2 +- .../Support/NullStorageService.cs | 3 +-- .../Upstream/DisabledUpstreamClientTests.cs | 1 + .../Upstream/DownloadsImporterTests.cs | 2 ++ .../PackageDownloadsJsonSourceTests.cs | 1 + .../Upstream/UpstreamAuthenticationTests.cs | 2 ++ .../Upstream/V3UpstreamClientTests.cs | 2 ++ .../BaGetter.Protocol.Tests.csproj | 2 +- ...ackageDependencyRangeJsonConverterTests.cs | 4 +-- .../StringOrStringArrayJsonConverterTests.cs | 4 +-- .../Models/PackageMetadataTests.cs | 9 +++---- .../NuGetClientFactoryTests.cs | 1 + .../NuGetClientTests.cs | 1 + .../RawAutocompleteClientTests.cs | 3 ++- .../RawCatalogClientTests.cs | 4 +-- .../RawPackageContentClientTests.cs | 3 ++- .../RawPackageMetadataClientTests.cs | 3 ++- .../RawSearchClientTests.cs | 3 ++- .../RawServiceIndexClientTests.cs | 4 ++- .../Support/ProtocolFixture.cs | 9 ++++--- .../Support/TestDataHttpMessageHandler.cs | 2 +- tests/BaGetter.Tests/ApiIntegrationTests.cs | 3 ++- .../BaGetClientIntegrationTests.cs | 14 ++++++----- .../BaGetter - Backup.Tests.csproj | 15 ++++++----- tests/BaGetter.Tests/BaGetter.Tests.csproj | 2 +- tests/BaGetter.Tests/HostIntegrationTests.cs | 2 +- .../BaGetter.Tests/MirrorIntegrationTests.cs | 1 + .../NuGetClientIntegrationTests.cs | 1 + ...AnonymousAuthenticationIntegrationTests.cs | 5 +--- .../NugetAuthenticationIntegrationTests.cs | 9 ++----- .../Support/BaGetApplication.cs | 8 +++--- .../HttpSourceResourceProviderTestHost.cs | 2 +- .../Support/StreamExtensions.cs | 2 +- tests/BaGetter.Tests/Support/TestResources.cs | 2 +- .../Support/TestableHttpSource.cs | 2 +- tests/BaGetter.Tests/Support/XunitLogger.cs | 2 +- .../Support/XunitLoggerProvider.cs | 2 +- .../TestData/TestData.Designer.cs | 5 +--- .../NugetBasicAuthenticationHandlerTests.cs | 4 +-- .../BaGetter.Web.Tests.csproj | 2 +- .../Pages/IndexModelFacts.cs | 5 ++-- .../Pages/PackageModelFacts.cs | 12 ++++++--- 259 files changed, 547 insertions(+), 373 deletions(-) diff --git a/Dockerfile b/Dockerfile index cf5a988fb..173b42092 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,6 @@ ARG Version=1.0.0 -FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:9.0-alpine AS build +FROM --platform=$BUILDPLATFORM mcr.microsoft.com/dotnet/sdk:10.0-alpine AS build ARG Version ARG TARGETARCH WORKDIR /src @@ -37,7 +37,7 @@ RUN mkdir -p "/data/packages" \ mkdir -p "/data/db" ## Create final image -FROM mcr.microsoft.com/dotnet/aspnet:9.0-alpine AS base +FROM mcr.microsoft.com/dotnet/aspnet:10.0-alpine AS base # install cultures (same approach as Alpine SDK image) RUN apk add --no-cache icu-libs icu-data-full tzdata # disable the invariant mode (set in base image) diff --git a/global.json b/global.json index 214a6386b..461364425 100644 --- a/global.json +++ b/global.json @@ -1,6 +1,6 @@ { "sdk": { - "version": "9.0.306", + "version": "10.0.104", "rollForward": "latestFeature", "allowPrerelease": false } diff --git a/samples/BaGetter.Protocol.Samples.Tests/BaGetter.Protocol.Samples.Tests.csproj b/samples/BaGetter.Protocol.Samples.Tests/BaGetter.Protocol.Samples.Tests.csproj index ae3faefab..095aabd2e 100644 --- a/samples/BaGetter.Protocol.Samples.Tests/BaGetter.Protocol.Samples.Tests.csproj +++ b/samples/BaGetter.Protocol.Samples.Tests/BaGetter.Protocol.Samples.Tests.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 false IDE0007 diff --git a/samples/BaGetter.Protocol.Samples.Tests/Sample03_Metadata.cs b/samples/BaGetter.Protocol.Samples.Tests/Sample03_Metadata.cs index 94dfd8d4d..b649d752b 100644 --- a/samples/BaGetter.Protocol.Samples.Tests/Sample03_Metadata.cs +++ b/samples/BaGetter.Protocol.Samples.Tests/Sample03_Metadata.cs @@ -2,7 +2,6 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; -using BaGetter.Protocol.Models; using NuGet.Versioning; using Xunit; @@ -16,7 +15,7 @@ public async Task GetAllPackageMetadata() // Find the metadata for all versions of a package. NuGetClient client = new NuGetClient("https://api.nuget.org/v3/index.json"); - IReadOnlyList items = await client.GetPackageMetadataAsync("Newtonsoft.Json"); + var items = await client.GetPackageMetadataAsync("Newtonsoft.Json"); if (!items.Any()) { Console.WriteLine($"Package 'Newtonsoft.Json' does not exist"); @@ -42,7 +41,7 @@ public async Task GetPackageMetadata() string packageId = "Newtonsoft.Json"; NuGetVersion packageVersion = new NuGetVersion("12.0.1"); - PackageMetadata metadata = await client.GetPackageMetadataAsync(packageId, packageVersion); + var metadata = await client.GetPackageMetadataAsync(packageId, packageVersion); Console.WriteLine($"Listed: {metadata.Listed}"); Console.WriteLine($"Tags: {metadata.Tags}"); diff --git a/samples/BaGetterWebApplication/BaGetterWebApplication.csproj b/samples/BaGetterWebApplication/BaGetterWebApplication.csproj index ac3e03237..de2098fb7 100644 --- a/samples/BaGetterWebApplication/BaGetterWebApplication.csproj +++ b/samples/BaGetterWebApplication/BaGetterWebApplication.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 diff --git a/samples/BaGetterWebApplication/Program.cs b/samples/BaGetterWebApplication/Program.cs index 00ade27ad..4400f2181 100644 --- a/samples/BaGetterWebApplication/Program.cs +++ b/samples/BaGetterWebApplication/Program.cs @@ -1,5 +1,7 @@ -using BaGetter; +using BaGetter.Core.Extensions; +using BaGetter.Database.Sqlite; using BaGetter.Web; +using BaGetter.Web.Extensions; using Microsoft.AspNetCore.Builder; using Microsoft.Extensions.Hosting; @@ -8,8 +10,8 @@ // This will add the BaGetter services and options to the container. builder.Services.AddBaGetterWebApplication(bagetter => { - bagetter.AddSqliteDatabase(); - bagetter.AddFileStorage(); + SqliteApplicationExtensions.AddSqliteDatabase(bagetter); + BaGetterApplicationExtensions.AddFileStorage(bagetter); }); var app = builder.Build(); diff --git a/src/BaGetter.Aliyun/AliyunApplicationExtensions.cs b/src/BaGetter.Aliyun/AliyunApplicationExtensions.cs index f60ff9c5a..93527ba89 100644 --- a/src/BaGetter.Aliyun/AliyunApplicationExtensions.cs +++ b/src/BaGetter.Aliyun/AliyunApplicationExtensions.cs @@ -1,12 +1,14 @@ using System; using Aliyun.OSS; -using BaGetter.Aliyun; using BaGetter.Core; +using BaGetter.Core.Configuration; +using BaGetter.Core.Extensions; +using BaGetter.Core.Storage; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; -namespace BaGetter; +namespace BaGetter.Aliyun; public static class AliyunApplicationExtensions { diff --git a/src/BaGetter.Aliyun/AliyunStorageService.cs b/src/BaGetter.Aliyun/AliyunStorageService.cs index c0d078a85..213cf6253 100644 --- a/src/BaGetter.Aliyun/AliyunStorageService.cs +++ b/src/BaGetter.Aliyun/AliyunStorageService.cs @@ -3,7 +3,7 @@ using System.Threading; using System.Threading.Tasks; using Aliyun.OSS; -using BaGetter.Core; +using BaGetter.Core.Storage; using Microsoft.Extensions.Options; namespace BaGetter.Aliyun; diff --git a/src/BaGetter.Aliyun/BaGetter.Aliyun.csproj b/src/BaGetter.Aliyun/BaGetter.Aliyun.csproj index 1eda2bc73..7578b5fba 100644 --- a/src/BaGetter.Aliyun/BaGetter.Aliyun.csproj +++ b/src/BaGetter.Aliyun/BaGetter.Aliyun.csproj @@ -2,7 +2,7 @@ NuGet;Alibaba;Cloud The libraries to host BaGetter on Alibaba Cloud (Aliyun). - net9.0 + net10.0 diff --git a/src/BaGetter.Aws/AwsApplicationExtensions.cs b/src/BaGetter.Aws/AwsApplicationExtensions.cs index 2e70fd64c..6831a5549 100644 --- a/src/BaGetter.Aws/AwsApplicationExtensions.cs +++ b/src/BaGetter.Aws/AwsApplicationExtensions.cs @@ -3,13 +3,15 @@ using Amazon; using Amazon.Runtime; using Amazon.S3; -using BaGetter.Aws; using BaGetter.Core; +using BaGetter.Core.Configuration; +using BaGetter.Core.Extensions; +using BaGetter.Core.Storage; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; -namespace BaGetter; +namespace BaGetter.Aws; public static class AwsApplicationExtensions { diff --git a/src/BaGetter.Aws/BaGetter.Aws.csproj b/src/BaGetter.Aws/BaGetter.Aws.csproj index 6e9e91ca4..e02a57156 100644 --- a/src/BaGetter.Aws/BaGetter.Aws.csproj +++ b/src/BaGetter.Aws/BaGetter.Aws.csproj @@ -1,8 +1,7 @@ - net9.0 - + net10.0 NuGet;Amazon;Cloud The libraries to host BaGetter on AWS. diff --git a/src/BaGetter.Aws/S3StorageOptions.cs b/src/BaGetter.Aws/S3StorageOptions.cs index aa30002f7..0cbe9d65d 100644 --- a/src/BaGetter.Aws/S3StorageOptions.cs +++ b/src/BaGetter.Aws/S3StorageOptions.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -using BaGetter.Core; +using BaGetter.Core.Validation; namespace BaGetter.Aws; diff --git a/src/BaGetter.Aws/S3StorageService.cs b/src/BaGetter.Aws/S3StorageService.cs index 160359acf..70d414c30 100644 --- a/src/BaGetter.Aws/S3StorageService.cs +++ b/src/BaGetter.Aws/S3StorageService.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; using Amazon.S3; using Amazon.S3.Model; -using BaGetter.Core; +using BaGetter.Core.Storage; using Microsoft.Extensions.Options; namespace BaGetter.Aws; diff --git a/src/BaGetter.Azure/AzureApplicationExtensions.cs b/src/BaGetter.Azure/AzureApplicationExtensions.cs index bca4bf413..7f0a691ea 100644 --- a/src/BaGetter.Azure/AzureApplicationExtensions.cs +++ b/src/BaGetter.Azure/AzureApplicationExtensions.cs @@ -2,13 +2,19 @@ using Azure.Data.Tables; using Azure.Storage; using Azure.Storage.Blobs; -using BaGetter.Azure; +using BaGetter.Azure.Configuration; +using BaGetter.Azure.Storage; +using BaGetter.Azure.Table; using BaGetter.Core; +using BaGetter.Core.Configuration; +using BaGetter.Core.Extensions; +using BaGetter.Core.Search; +using BaGetter.Core.Storage; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; -namespace BaGetter +namespace BaGetter.Azure { public static class AzureApplicationExtensions { diff --git a/src/BaGetter.Azure/BaGetter.Azure.csproj b/src/BaGetter.Azure/BaGetter.Azure.csproj index ce89a11f3..5c4a39095 100644 --- a/src/BaGetter.Azure/BaGetter.Azure.csproj +++ b/src/BaGetter.Azure/BaGetter.Azure.csproj @@ -1,8 +1,7 @@ - net9.0 - + net10.0 NuGet;Azure;Cloud The libraries to host BaGetter on Azure. diff --git a/src/BaGetter.Azure/Configuration/AzureBlobStorageOptions.cs b/src/BaGetter.Azure/Configuration/AzureBlobStorageOptions.cs index 6e349e05c..c7a4d4d91 100644 --- a/src/BaGetter.Azure/Configuration/AzureBlobStorageOptions.cs +++ b/src/BaGetter.Azure/Configuration/AzureBlobStorageOptions.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -namespace BaGetter.Azure +namespace BaGetter.Azure.Configuration { /// /// BaGetter's configurations to use Azure Blob Storage to store packages. @@ -22,7 +22,7 @@ public class AzureBlobStorageOptions : IValidatableObject /// /// The Azure Blob Storage access key. Ignored if is provided. - /// + /// public string AccessKey { get; set; } /// diff --git a/src/BaGetter.Azure/Configuration/AzureSearchOptions.cs b/src/BaGetter.Azure/Configuration/AzureSearchOptions.cs index 11a165bf9..709b09e5c 100644 --- a/src/BaGetter.Azure/Configuration/AzureSearchOptions.cs +++ b/src/BaGetter.Azure/Configuration/AzureSearchOptions.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace BaGetter.Azure +namespace BaGetter.Azure.Configuration { public class AzureSearchOptions { diff --git a/src/BaGetter.Azure/Configuration/AzureTableOptions.cs b/src/BaGetter.Azure/Configuration/AzureTableOptions.cs index 60351e1e5..1c9283cd0 100644 --- a/src/BaGetter.Azure/Configuration/AzureTableOptions.cs +++ b/src/BaGetter.Azure/Configuration/AzureTableOptions.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace BaGetter.Azure +namespace BaGetter.Azure.Configuration { public class AzureTableOptions { diff --git a/src/BaGetter.Azure/Extensions/StorageExceptionExtensions.cs b/src/BaGetter.Azure/Extensions/StorageExceptionExtensions.cs index 115c808f8..d4ce69248 100644 --- a/src/BaGetter.Azure/Extensions/StorageExceptionExtensions.cs +++ b/src/BaGetter.Azure/Extensions/StorageExceptionExtensions.cs @@ -1,7 +1,7 @@ -using Azure; using System.Net; +using Azure; -namespace BaGetter.Azure +namespace BaGetter.Azure.Extensions { internal static class StorageExceptionExtensions diff --git a/src/BaGetter.Azure/Storage/BlobStorageService.cs b/src/BaGetter.Azure/Storage/BlobStorageService.cs index 7a2c1a0e3..ddbf0958c 100644 --- a/src/BaGetter.Azure/Storage/BlobStorageService.cs +++ b/src/BaGetter.Azure/Storage/BlobStorageService.cs @@ -6,9 +6,11 @@ using Azure.Storage.Blobs; using Azure.Storage.Blobs.Models; using Azure.Storage.Sas; -using BaGetter.Core; +using BaGetter.Azure.Extensions; +using BaGetter.Core.Extensions; +using BaGetter.Core.Storage; -namespace BaGetter.Azure +namespace BaGetter.Azure.Storage { // See: https://github.com/NuGet/NuGetGallery/blob/master/src/NuGetGallery.Core/Services/CloudBlobCoreFileStorageService.cs public class BlobStorageService : IStorageService diff --git a/src/BaGetter.Azure/Table/PackageEntity.cs b/src/BaGetter.Azure/Table/PackageEntity.cs index 6e2daed84..dc432e055 100644 --- a/src/BaGetter.Azure/Table/PackageEntity.cs +++ b/src/BaGetter.Azure/Table/PackageEntity.cs @@ -1,9 +1,9 @@ using System; using Azure; using Azure.Data.Tables; -using BaGetter.Core; +using BaGetter.Core.Entities; -namespace BaGetter.Azure +namespace BaGetter.Azure.Table { /// /// The Azure Table Storage entity that maps to a . diff --git a/src/BaGetter.Azure/Table/PackageEntityExtensions.cs b/src/BaGetter.Azure/Table/PackageEntityExtensions.cs index 8a23231b6..1ffcb7bd9 100644 --- a/src/BaGetter.Azure/Table/PackageEntityExtensions.cs +++ b/src/BaGetter.Azure/Table/PackageEntityExtensions.cs @@ -2,9 +2,9 @@ using System.Collections.Generic; using System.Linq; using System.Text.Json; -using BaGetter.Core; +using BaGetter.Core.Entities; -namespace BaGetter.Azure +namespace BaGetter.Azure.Table { public static class PackageEntityExtensions { diff --git a/src/BaGetter.Azure/Table/TableOperationBuilder.cs b/src/BaGetter.Azure/Table/TableOperationBuilder.cs index 979edba8c..1bec1f4ec 100644 --- a/src/BaGetter.Azure/Table/TableOperationBuilder.cs +++ b/src/BaGetter.Azure/Table/TableOperationBuilder.cs @@ -1,10 +1,10 @@ using System; using System.Collections.Generic; using System.Linq; -using BaGetter.Core; +using BaGetter.Core.Entities; using Newtonsoft.Json; -namespace BaGetter.Azure +namespace BaGetter.Azure.Table { public class TableOperationBuilder { diff --git a/src/BaGetter.Azure/Table/TablePackageDatabase.cs b/src/BaGetter.Azure/Table/TablePackageDatabase.cs index 9bf5341d7..4d2303366 100644 --- a/src/BaGetter.Azure/Table/TablePackageDatabase.cs +++ b/src/BaGetter.Azure/Table/TablePackageDatabase.cs @@ -6,12 +6,15 @@ using System.Threading.Tasks; using Azure; using Azure.Data.Tables; +using BaGetter.Azure.Configuration; +using BaGetter.Azure.Extensions; using BaGetter.Core; +using BaGetter.Core.Entities; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using NuGet.Versioning; -namespace BaGetter.Azure +namespace BaGetter.Azure.Table { /// /// Stores the metadata of packages using Azure Table Storage. diff --git a/src/BaGetter.Azure/Table/TableSearchService.cs b/src/BaGetter.Azure/Table/TableSearchService.cs index 6fc62adcc..a2060a2af 100644 --- a/src/BaGetter.Azure/Table/TableSearchService.cs +++ b/src/BaGetter.Azure/Table/TableSearchService.cs @@ -5,11 +5,14 @@ using System.Threading.Tasks; using Azure; using Azure.Data.Tables; -using BaGetter.Core; +using BaGetter.Azure.Configuration; +using BaGetter.Core.Entities; +using BaGetter.Core.Metadata; +using BaGetter.Core.Search; using BaGetter.Protocol.Models; using Microsoft.Extensions.Options; -namespace BaGetter.Azure +namespace BaGetter.Azure.Table { public class TableSearchService : ISearchService { diff --git a/src/BaGetter.Core/Authentication/ApiKeyAuthenticationService.cs b/src/BaGetter.Core/Authentication/ApiKeyAuthenticationService.cs index 1a7cfb54b..4425e3121 100644 --- a/src/BaGetter.Core/Authentication/ApiKeyAuthenticationService.cs +++ b/src/BaGetter.Core/Authentication/ApiKeyAuthenticationService.cs @@ -5,7 +5,7 @@ using BaGetter.Core.Configuration; using Microsoft.Extensions.Options; -namespace BaGetter.Core; +namespace BaGetter.Core.Authentication; public class ApiKeyAuthenticationService : IAuthenticationService { diff --git a/src/BaGetter.Core/Authentication/AuthenticationConstants.cs b/src/BaGetter.Core/Authentication/AuthenticationConstants.cs index f6ff708ea..f7d8e0526 100644 --- a/src/BaGetter.Core/Authentication/AuthenticationConstants.cs +++ b/src/BaGetter.Core/Authentication/AuthenticationConstants.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace BaGetter.Authentication; +namespace BaGetter.Core.Authentication; public static class AuthenticationConstants { public const string NugetBasicAuthenticationScheme = "NugetBasicAuthentication"; diff --git a/src/BaGetter.Core/Authentication/IAuthenticationService.cs b/src/BaGetter.Core/Authentication/IAuthenticationService.cs index 6cd3547fb..37c46459a 100644 --- a/src/BaGetter.Core/Authentication/IAuthenticationService.cs +++ b/src/BaGetter.Core/Authentication/IAuthenticationService.cs @@ -1,7 +1,7 @@ using System.Threading; using System.Threading.Tasks; -namespace BaGetter.Core; +namespace BaGetter.Core.Authentication; public interface IAuthenticationService { diff --git a/src/BaGetter.Core/BaGetter.Core.csproj b/src/BaGetter.Core/BaGetter.Core.csproj index 04d25e6da..c3ccf2b28 100644 --- a/src/BaGetter.Core/BaGetter.Core.csproj +++ b/src/BaGetter.Core/BaGetter.Core.csproj @@ -1,6 +1,6 @@ - net9.0 + net10.0 NuGet The core libraries that power BaGetter. diff --git a/src/BaGetter.Core/Configuration/ApiKey.cs b/src/BaGetter.Core/Configuration/ApiKey.cs index bb94f661a..83ee81f6a 100644 --- a/src/BaGetter.Core/Configuration/ApiKey.cs +++ b/src/BaGetter.Core/Configuration/ApiKey.cs @@ -1,9 +1,3 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - namespace BaGetter.Core.Configuration; public class ApiKey { diff --git a/src/BaGetter.Core/Configuration/BaGetterOptions.cs b/src/BaGetter.Core/Configuration/BaGetterOptions.cs index 8b2e94648..c860bacde 100644 --- a/src/BaGetter.Core/Configuration/BaGetterOptions.cs +++ b/src/BaGetter.Core/Configuration/BaGetterOptions.cs @@ -1,7 +1,6 @@ using System; -using BaGetter.Core.Configuration; -namespace BaGetter.Core; +namespace BaGetter.Core.Configuration; public class BaGetterOptions { diff --git a/src/BaGetter.Core/Configuration/BindOptions.cs b/src/BaGetter.Core/Configuration/BindOptions.cs index d815a68ac..b3053e670 100644 --- a/src/BaGetter.Core/Configuration/BindOptions.cs +++ b/src/BaGetter.Core/Configuration/BindOptions.cs @@ -2,7 +2,7 @@ using Microsoft.Extensions.Configuration; using Microsoft.Extensions.Options; -namespace BaGetter.Core; +namespace BaGetter.Core.Configuration; /// /// Automatically binds configs to options. diff --git a/src/BaGetter.Core/Configuration/DatabaseOptions.cs b/src/BaGetter.Core/Configuration/DatabaseOptions.cs index f2fbee842..f90f4302d 100644 --- a/src/BaGetter.Core/Configuration/DatabaseOptions.cs +++ b/src/BaGetter.Core/Configuration/DatabaseOptions.cs @@ -1,6 +1,6 @@ using System.ComponentModel.DataAnnotations; -namespace BaGetter.Core; +namespace BaGetter.Core.Configuration; public class DatabaseOptions { diff --git a/src/BaGetter.Core/Configuration/FileSystemStorageOptions.cs b/src/BaGetter.Core/Configuration/FileSystemStorageOptions.cs index 08d2ac46e..089ededd9 100644 --- a/src/BaGetter.Core/Configuration/FileSystemStorageOptions.cs +++ b/src/BaGetter.Core/Configuration/FileSystemStorageOptions.cs @@ -3,7 +3,7 @@ using System.IO; using System.Linq; -namespace BaGetter.Core; +namespace BaGetter.Core.Configuration; public class FileSystemStorageOptions : IValidatableObject { diff --git a/src/BaGetter.Core/Configuration/HealthCheckOptions.cs b/src/BaGetter.Core/Configuration/HealthCheckOptions.cs index 2e673a283..b2c832f2b 100644 --- a/src/BaGetter.Core/Configuration/HealthCheckOptions.cs +++ b/src/BaGetter.Core/Configuration/HealthCheckOptions.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -namespace BaGetter.Core; +namespace BaGetter.Core.Configuration; public class HealthCheckOptions : IValidatableObject { diff --git a/src/BaGetter.Core/Configuration/MirrorAuthenticationOptions.cs b/src/BaGetter.Core/Configuration/MirrorAuthenticationOptions.cs index c9bc76007..aa523ca4b 100644 --- a/src/BaGetter.Core/Configuration/MirrorAuthenticationOptions.cs +++ b/src/BaGetter.Core/Configuration/MirrorAuthenticationOptions.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace BaGetter.Core; +namespace BaGetter.Core.Configuration; public class MirrorAuthenticationOptions { diff --git a/src/BaGetter.Core/Configuration/MirrorAuthenticationType.cs b/src/BaGetter.Core/Configuration/MirrorAuthenticationType.cs index 89d683003..96aacc861 100644 --- a/src/BaGetter.Core/Configuration/MirrorAuthenticationType.cs +++ b/src/BaGetter.Core/Configuration/MirrorAuthenticationType.cs @@ -1,4 +1,4 @@ -namespace BaGetter.Core; +namespace BaGetter.Core.Configuration; public enum MirrorAuthenticationType { diff --git a/src/BaGetter.Core/Configuration/MirrorOptions.cs b/src/BaGetter.Core/Configuration/MirrorOptions.cs index c13f60f90..0dab28d4a 100644 --- a/src/BaGetter.Core/Configuration/MirrorOptions.cs +++ b/src/BaGetter.Core/Configuration/MirrorOptions.cs @@ -2,7 +2,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -namespace BaGetter.Core; +namespace BaGetter.Core.Configuration; public class MirrorOptions : IValidatableObject { diff --git a/src/BaGetter.Core/Configuration/NugetAuthenticationOptions.cs b/src/BaGetter.Core/Configuration/NugetAuthenticationOptions.cs index 4d608fd8b..3decdde96 100644 --- a/src/BaGetter.Core/Configuration/NugetAuthenticationOptions.cs +++ b/src/BaGetter.Core/Configuration/NugetAuthenticationOptions.cs @@ -1,6 +1,4 @@ -using BaGetter.Core.Configuration; - -namespace BaGetter.Core; +namespace BaGetter.Core.Configuration; public sealed class NugetAuthenticationOptions { diff --git a/src/BaGetter.Core/Configuration/NugetCredentials.cs b/src/BaGetter.Core/Configuration/NugetCredentials.cs index 5cd5579bf..e037bd61c 100644 --- a/src/BaGetter.Core/Configuration/NugetCredentials.cs +++ b/src/BaGetter.Core/Configuration/NugetCredentials.cs @@ -1,4 +1,4 @@ -namespace BaGetter.Core; +namespace BaGetter.Core.Configuration; public sealed class NugetCredentials { diff --git a/src/BaGetter.Core/Configuration/PackageDeletionBehavior.cs b/src/BaGetter.Core/Configuration/PackageDeletionBehavior.cs index 2d4528d71..5a36863df 100644 --- a/src/BaGetter.Core/Configuration/PackageDeletionBehavior.cs +++ b/src/BaGetter.Core/Configuration/PackageDeletionBehavior.cs @@ -1,4 +1,4 @@ -namespace BaGetter.Core; +namespace BaGetter.Core.Configuration; /// /// How BaGetter should interpret package deletion requests. diff --git a/src/BaGetter.Core/Configuration/PackageOverwriteAllowed.cs b/src/BaGetter.Core/Configuration/PackageOverwriteAllowed.cs index 8291efd8b..86c51b7f6 100644 --- a/src/BaGetter.Core/Configuration/PackageOverwriteAllowed.cs +++ b/src/BaGetter.Core/Configuration/PackageOverwriteAllowed.cs @@ -1,4 +1,4 @@ -namespace BaGetter.Core; +namespace BaGetter.Core.Configuration; /// /// How BaGetter should react to a package being pushed that already exists. diff --git a/src/BaGetter.Core/Configuration/RetentionOptions.cs b/src/BaGetter.Core/Configuration/RetentionOptions.cs index 48bc10133..27501920c 100644 --- a/src/BaGetter.Core/Configuration/RetentionOptions.cs +++ b/src/BaGetter.Core/Configuration/RetentionOptions.cs @@ -1,4 +1,4 @@ -namespace BaGetter.Core; +namespace BaGetter.Core.Configuration; public class RetentionOptions { diff --git a/src/BaGetter.Core/Configuration/SearchOptions.cs b/src/BaGetter.Core/Configuration/SearchOptions.cs index 0e0c3aada..d645427fa 100644 --- a/src/BaGetter.Core/Configuration/SearchOptions.cs +++ b/src/BaGetter.Core/Configuration/SearchOptions.cs @@ -1,4 +1,4 @@ -namespace BaGetter.Core; +namespace BaGetter.Core.Configuration; public class SearchOptions { diff --git a/src/BaGetter.Core/Configuration/StatisticsOptions.cs b/src/BaGetter.Core/Configuration/StatisticsOptions.cs index 5aa25c9d6..ff9119ee9 100644 --- a/src/BaGetter.Core/Configuration/StatisticsOptions.cs +++ b/src/BaGetter.Core/Configuration/StatisticsOptions.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; -namespace BaGetter.Core; +namespace BaGetter.Core.Configuration; public class StatisticsOptions : IValidatableObject { diff --git a/src/BaGetter.Core/Configuration/StorageOptions.cs b/src/BaGetter.Core/Configuration/StorageOptions.cs index e2a32f6b3..35514f4d4 100644 --- a/src/BaGetter.Core/Configuration/StorageOptions.cs +++ b/src/BaGetter.Core/Configuration/StorageOptions.cs @@ -1,4 +1,4 @@ -namespace BaGetter.Core; +namespace BaGetter.Core.Configuration; public class StorageOptions { diff --git a/src/BaGetter.Core/Content/DefaultPackageContentService.cs b/src/BaGetter.Core/Content/DefaultPackageContentService.cs index b122c268c..a5888a7f2 100644 --- a/src/BaGetter.Core/Content/DefaultPackageContentService.cs +++ b/src/BaGetter.Core/Content/DefaultPackageContentService.cs @@ -3,10 +3,11 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Storage; using BaGetter.Protocol.Models; using NuGet.Versioning; -namespace BaGetter.Core; +namespace BaGetter.Core.Content; /// /// Implements the NuGet Package Content resource in NuGet's V3 protocol. diff --git a/src/BaGetter.Core/Content/IPackageContentService.cs b/src/BaGetter.Core/Content/IPackageContentService.cs index 1c4018bda..a4e527846 100644 --- a/src/BaGetter.Core/Content/IPackageContentService.cs +++ b/src/BaGetter.Core/Content/IPackageContentService.cs @@ -4,7 +4,7 @@ using BaGetter.Protocol.Models; using NuGet.Versioning; -namespace BaGetter.Core; +namespace BaGetter.Core.Content; /// /// The Package Content resource, used to download NuGet packages and to fetch other metadata. diff --git a/src/BaGetter.Core/Entities/AbstractContext.cs b/src/BaGetter.Core/Entities/AbstractContext.cs index 3e1874493..7e9f2cff2 100644 --- a/src/BaGetter.Core/Entities/AbstractContext.cs +++ b/src/BaGetter.Core/Entities/AbstractContext.cs @@ -1,9 +1,10 @@ using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Entities.Converters; using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Metadata.Builders; -namespace BaGetter.Core; +namespace BaGetter.Core.Entities; public abstract class AbstractContext : DbContext, IContext where TContext : DbContext { diff --git a/src/BaGetter.Core/Entities/Converters/StringArrayComparer.cs b/src/BaGetter.Core/Entities/Converters/StringArrayComparer.cs index 973ebbf7b..35e24b7dc 100644 --- a/src/BaGetter.Core/Entities/Converters/StringArrayComparer.cs +++ b/src/BaGetter.Core/Entities/Converters/StringArrayComparer.cs @@ -2,7 +2,7 @@ using System.Linq; using Microsoft.EntityFrameworkCore.ChangeTracking; -namespace BaGetter.Core; +namespace BaGetter.Core.Entities.Converters; public class StringArrayComparer : ValueComparer { diff --git a/src/BaGetter.Core/Entities/Converters/StringArrayToJsonConverter.cs b/src/BaGetter.Core/Entities/Converters/StringArrayToJsonConverter.cs index f7814af81..013fe7089 100644 --- a/src/BaGetter.Core/Entities/Converters/StringArrayToJsonConverter.cs +++ b/src/BaGetter.Core/Entities/Converters/StringArrayToJsonConverter.cs @@ -2,7 +2,7 @@ using Microsoft.EntityFrameworkCore.Storage.ValueConversion; using Newtonsoft.Json; -namespace BaGetter.Core; +namespace BaGetter.Core.Entities.Converters; public class StringArrayToJsonConverter : ValueConverter { diff --git a/src/BaGetter.Core/Entities/Converters/UriToStringConverter.cs b/src/BaGetter.Core/Entities/Converters/UriToStringConverter.cs index 90c91bead..360b4761f 100644 --- a/src/BaGetter.Core/Entities/Converters/UriToStringConverter.cs +++ b/src/BaGetter.Core/Entities/Converters/UriToStringConverter.cs @@ -1,7 +1,7 @@ using System; using Microsoft.EntityFrameworkCore.Storage.ValueConversion; -namespace BaGetter.Core; +namespace BaGetter.Core.Entities.Converters; public class UriToStringConverter : ValueConverter { diff --git a/src/BaGetter.Core/Entities/IContext.cs b/src/BaGetter.Core/Entities/IContext.cs index 2e96f9229..01019fc3f 100644 --- a/src/BaGetter.Core/Entities/IContext.cs +++ b/src/BaGetter.Core/Entities/IContext.cs @@ -3,7 +3,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; -namespace BaGetter.Core; +namespace BaGetter.Core.Entities; public interface IContext { diff --git a/src/BaGetter.Core/Entities/NullContext.cs b/src/BaGetter.Core/Entities/NullContext.cs index 898a03a11..80248c66c 100644 --- a/src/BaGetter.Core/Entities/NullContext.cs +++ b/src/BaGetter.Core/Entities/NullContext.cs @@ -4,7 +4,7 @@ using Microsoft.EntityFrameworkCore; using Microsoft.EntityFrameworkCore.Infrastructure; -namespace BaGetter.Core; +namespace BaGetter.Core.Entities; public class NullContext : IContext { diff --git a/src/BaGetter.Core/Entities/Package.cs b/src/BaGetter.Core/Entities/Package.cs index d3c44ebdf..f1067705b 100644 --- a/src/BaGetter.Core/Entities/Package.cs +++ b/src/BaGetter.Core/Entities/Package.cs @@ -3,7 +3,7 @@ using System.Diagnostics; using NuGet.Versioning; -namespace BaGetter.Core; +namespace BaGetter.Core.Entities; // See NuGetGallery's: https://github.com/NuGet/NuGetGallery/blob/master/src/NuGetGallery.Core/Entities/Package.cs [DebuggerDisplay("{Id} {Version}")] diff --git a/src/BaGetter.Core/Entities/PackageDependency.cs b/src/BaGetter.Core/Entities/PackageDependency.cs index b00d820f1..aed2c76fa 100644 --- a/src/BaGetter.Core/Entities/PackageDependency.cs +++ b/src/BaGetter.Core/Entities/PackageDependency.cs @@ -1,4 +1,4 @@ -namespace BaGetter.Core; +namespace BaGetter.Core.Entities; // See NuGetGallery.Core's: https://github.com/NuGet/NuGetGallery/blob/master/src/NuGetGallery.Core/Entities/PackageDependency.cs public class PackageDependency diff --git a/src/BaGetter.Core/Entities/PackageType.cs b/src/BaGetter.Core/Entities/PackageType.cs index 465423d16..b45f2dd3f 100644 --- a/src/BaGetter.Core/Entities/PackageType.cs +++ b/src/BaGetter.Core/Entities/PackageType.cs @@ -1,4 +1,4 @@ -namespace BaGetter.Core; +namespace BaGetter.Core.Entities; // See NuGetGallery.Core's: https://github.com/NuGet/NuGetGallery/blob/master/src/NuGetGallery.Core/Entities/PackageType.cs public class PackageType diff --git a/src/BaGetter.Core/Entities/SemVerLevel.cs b/src/BaGetter.Core/Entities/SemVerLevel.cs index 6d89fc2a1..22ad45794 100644 --- a/src/BaGetter.Core/Entities/SemVerLevel.cs +++ b/src/BaGetter.Core/Entities/SemVerLevel.cs @@ -1,4 +1,4 @@ -namespace BaGetter.Core; +namespace BaGetter.Core.Entities; public enum SemVerLevel { diff --git a/src/BaGetter.Core/Entities/TargetFramework.cs b/src/BaGetter.Core/Entities/TargetFramework.cs index 511caae8e..17203956a 100644 --- a/src/BaGetter.Core/Entities/TargetFramework.cs +++ b/src/BaGetter.Core/Entities/TargetFramework.cs @@ -1,4 +1,4 @@ -namespace BaGetter.Core; +namespace BaGetter.Core.Entities; public class TargetFramework { diff --git a/src/BaGetter.Core/Extensions/BaGetterApplicationExtensions.cs b/src/BaGetter.Core/Extensions/BaGetterApplicationExtensions.cs index 59f1a73cf..f5ced3ce6 100644 --- a/src/BaGetter.Core/Extensions/BaGetterApplicationExtensions.cs +++ b/src/BaGetter.Core/Extensions/BaGetterApplicationExtensions.cs @@ -1,10 +1,12 @@ using System; -using BaGetter.Core; +using BaGetter.Core.Configuration; +using BaGetter.Core.Search; using BaGetter.Core.Statistics; +using BaGetter.Core.Storage; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; -namespace BaGetter; +namespace BaGetter.Core.Extensions; public static class BaGetterApplicationExtensions { diff --git a/src/BaGetter.Core/Extensions/DependencyInjectionExtensions.Providers.cs b/src/BaGetter.Core/Extensions/DependencyInjectionExtensions.Providers.cs index b0de4b776..8d8aaedfb 100644 --- a/src/BaGetter.Core/Extensions/DependencyInjectionExtensions.Providers.cs +++ b/src/BaGetter.Core/Extensions/DependencyInjectionExtensions.Providers.cs @@ -1,11 +1,14 @@ using System; using System.Collections.Generic; +using BaGetter.Core.Configuration; +using BaGetter.Core.Entities; +using BaGetter.Core.Search; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; -namespace BaGetter.Core; +namespace BaGetter.Core.Extensions; public static partial class DependencyInjectionExtensions { diff --git a/src/BaGetter.Core/Extensions/DependencyInjectionExtensions.cs b/src/BaGetter.Core/Extensions/DependencyInjectionExtensions.cs index e4d71e85e..e35575aa5 100644 --- a/src/BaGetter.Core/Extensions/DependencyInjectionExtensions.cs +++ b/src/BaGetter.Core/Extensions/DependencyInjectionExtensions.cs @@ -4,14 +4,26 @@ using System.Net.Http.Headers; using System.Reflection; using System.Text; +using BaGetter.Core.Authentication; +using BaGetter.Core.Configuration; +using BaGetter.Core.Content; +using BaGetter.Core.Entities; +using BaGetter.Core.Indexing; +using BaGetter.Core.Metadata; +using BaGetter.Core.Search; +using BaGetter.Core.ServiceIndex; using BaGetter.Core.Statistics; +using BaGetter.Core.Storage; +using BaGetter.Core.Upstream; +using BaGetter.Core.Upstream.Clients; +using BaGetter.Core.Validation; using BaGetter.Protocol; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; -namespace BaGetter.Core; +namespace BaGetter.Core.Extensions; public static partial class DependencyInjectionExtensions { diff --git a/src/BaGetter.Core/Extensions/HealthCheckExtensions.cs b/src/BaGetter.Core/Extensions/HealthCheckExtensions.cs index 059b51370..bebc9e841 100644 --- a/src/BaGetter.Core/Extensions/HealthCheckExtensions.cs +++ b/src/BaGetter.Core/Extensions/HealthCheckExtensions.cs @@ -5,6 +5,7 @@ using System.Text.Json.Serialization; using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Configuration; using Microsoft.Extensions.Diagnostics.HealthChecks; namespace BaGetter.Core.Extensions; diff --git a/src/BaGetter.Core/Extensions/IProvider.cs b/src/BaGetter.Core/Extensions/IProvider.cs index 0b45b3bee..cd0571040 100644 --- a/src/BaGetter.Core/Extensions/IProvider.cs +++ b/src/BaGetter.Core/Extensions/IProvider.cs @@ -1,7 +1,7 @@ using System; using Microsoft.Extensions.Configuration; -namespace BaGetter.Core; +namespace BaGetter.Core.Extensions; /// /// Attempts to provide the . diff --git a/src/BaGetter.Core/Extensions/PackageArchiveReaderExtensions.cs b/src/BaGetter.Core/Extensions/PackageArchiveReaderExtensions.cs index 4cbd84852..d6fb86b5c 100644 --- a/src/BaGetter.Core/Extensions/PackageArchiveReaderExtensions.cs +++ b/src/BaGetter.Core/Extensions/PackageArchiveReaderExtensions.cs @@ -4,10 +4,11 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Entities; using NuGet.Common; using NuGet.Packaging; -namespace BaGetter.Core; +namespace BaGetter.Core.Extensions; using NuGetPackageType = NuGet.Packaging.Core.PackageType; diff --git a/src/BaGetter.Core/Extensions/StreamExtensions.cs b/src/BaGetter.Core/Extensions/StreamExtensions.cs index 70c6fd96f..f0f4df05e 100644 --- a/src/BaGetter.Core/Extensions/StreamExtensions.cs +++ b/src/BaGetter.Core/Extensions/StreamExtensions.cs @@ -1,11 +1,10 @@ using System; using System.IO; -using System.Linq; using System.Security.Cryptography; using System.Threading; using System.Threading.Tasks; -namespace BaGetter.Core; +namespace BaGetter.Core.Extensions; public static class StreamExtensions { diff --git a/src/BaGetter.Core/Extensions/SystemTime.cs b/src/BaGetter.Core/Extensions/SystemTime.cs index 96922f3e6..438113848 100644 --- a/src/BaGetter.Core/Extensions/SystemTime.cs +++ b/src/BaGetter.Core/Extensions/SystemTime.cs @@ -1,6 +1,6 @@ using System; -namespace BaGetter.Core; +namespace BaGetter.Core.Extensions; /// /// A wrapper that allows for unit tests related to system time. diff --git a/src/BaGetter.Core/IPackageDatabase.cs b/src/BaGetter.Core/IPackageDatabase.cs index d855b06ec..19857bf67 100644 --- a/src/BaGetter.Core/IPackageDatabase.cs +++ b/src/BaGetter.Core/IPackageDatabase.cs @@ -1,6 +1,8 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Entities; +using BaGetter.Core.Storage; using NuGet.Versioning; namespace BaGetter.Core; diff --git a/src/BaGetter.Core/IPackageService.cs b/src/BaGetter.Core/IPackageService.cs index 1d0d0213b..d95f0758d 100644 --- a/src/BaGetter.Core/IPackageService.cs +++ b/src/BaGetter.Core/IPackageService.cs @@ -1,6 +1,8 @@ using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Entities; +using BaGetter.Core.Upstream; using NuGet.Versioning; namespace BaGetter.Core; diff --git a/src/BaGetter.Core/Indexing/FrameworkCompatibilityService.cs b/src/BaGetter.Core/Indexing/FrameworkCompatibilityService.cs index df207c165..d3158f7c5 100644 --- a/src/BaGetter.Core/Indexing/FrameworkCompatibilityService.cs +++ b/src/BaGetter.Core/Indexing/FrameworkCompatibilityService.cs @@ -4,7 +4,7 @@ using System.Linq; using NuGet.Frameworks; -namespace BaGetter.Core; +namespace BaGetter.Core.Indexing; using static NuGet.Frameworks.FrameworkConstants; diff --git a/src/BaGetter.Core/Indexing/IFrameworkCompatibilityService.cs b/src/BaGetter.Core/Indexing/IFrameworkCompatibilityService.cs index 0903fa640..9546f8c5e 100644 --- a/src/BaGetter.Core/Indexing/IFrameworkCompatibilityService.cs +++ b/src/BaGetter.Core/Indexing/IFrameworkCompatibilityService.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; -namespace BaGetter.Core; +namespace BaGetter.Core.Indexing; /// /// Used to determine the compatibility matrix between frameworks. diff --git a/src/BaGetter.Core/Indexing/IPackageDeletionService.cs b/src/BaGetter.Core/Indexing/IPackageDeletionService.cs index 3934873f6..f8f054ee4 100644 --- a/src/BaGetter.Core/Indexing/IPackageDeletionService.cs +++ b/src/BaGetter.Core/Indexing/IPackageDeletionService.cs @@ -1,8 +1,9 @@ using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Entities; using NuGet.Versioning; -namespace BaGetter.Core; +namespace BaGetter.Core.Indexing; public interface IPackageDeletionService { diff --git a/src/BaGetter.Core/Indexing/IPackageIndexingService.cs b/src/BaGetter.Core/Indexing/IPackageIndexingService.cs index 7e1b999f8..c47779a73 100644 --- a/src/BaGetter.Core/Indexing/IPackageIndexingService.cs +++ b/src/BaGetter.Core/Indexing/IPackageIndexingService.cs @@ -2,7 +2,7 @@ using System.Threading; using System.Threading.Tasks; -namespace BaGetter.Core; +namespace BaGetter.Core.Indexing; /// /// The result of attempting to index a package. diff --git a/src/BaGetter.Core/Indexing/ISymbolIndexingService.cs b/src/BaGetter.Core/Indexing/ISymbolIndexingService.cs index 698c00830..89a34ff96 100644 --- a/src/BaGetter.Core/Indexing/ISymbolIndexingService.cs +++ b/src/BaGetter.Core/Indexing/ISymbolIndexingService.cs @@ -2,7 +2,7 @@ using System.Threading; using System.Threading.Tasks; -namespace BaGetter.Core; +namespace BaGetter.Core.Indexing; /// /// The result of attempting to index a symbol package. diff --git a/src/BaGetter.Core/Indexing/PackageDeletionService.cs b/src/BaGetter.Core/Indexing/PackageDeletionService.cs index 85a51984c..24a8a6046 100644 --- a/src/BaGetter.Core/Indexing/PackageDeletionService.cs +++ b/src/BaGetter.Core/Indexing/PackageDeletionService.cs @@ -3,11 +3,14 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Configuration; +using BaGetter.Core.Entities; +using BaGetter.Core.Storage; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using NuGet.Versioning; -namespace BaGetter.Core; +namespace BaGetter.Core.Indexing; public class PackageDeletionService : IPackageDeletionService { diff --git a/src/BaGetter.Core/Indexing/PackageIndexingService.cs b/src/BaGetter.Core/Indexing/PackageIndexingService.cs index ad015718d..cb879feb9 100644 --- a/src/BaGetter.Core/Indexing/PackageIndexingService.cs +++ b/src/BaGetter.Core/Indexing/PackageIndexingService.cs @@ -2,11 +2,16 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Configuration; +using BaGetter.Core.Entities; +using BaGetter.Core.Extensions; +using BaGetter.Core.Search; +using BaGetter.Core.Storage; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using NuGet.Packaging; -namespace BaGetter.Core; +namespace BaGetter.Core.Indexing; public class PackageIndexingService : IPackageIndexingService { diff --git a/src/BaGetter.Core/Indexing/SymbolIndexingService.cs b/src/BaGetter.Core/Indexing/SymbolIndexingService.cs index a6a50b1fb..ad07567f3 100644 --- a/src/BaGetter.Core/Indexing/SymbolIndexingService.cs +++ b/src/BaGetter.Core/Indexing/SymbolIndexingService.cs @@ -5,10 +5,12 @@ using System.Reflection.Metadata; using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Extensions; +using BaGetter.Core.Storage; using Microsoft.Extensions.Logging; using NuGet.Packaging; -namespace BaGetter.Core; +namespace BaGetter.Core.Indexing; // Based off: https://github.com/NuGet/NuGetGallery/blob/master/src/NuGetGallery/Services/SymbolPackageUploadService.cs // Based off: https://github.com/NuGet/NuGet.Jobs/blob/master/src/Validation.Symbols/SymbolsValidatorService.cs#L44 diff --git a/src/BaGetter.Core/Metadata/BaGetRegistrationIndexPageItem.cs b/src/BaGetter.Core/Metadata/BaGetRegistrationIndexPageItem.cs index db7beaa7d..991c5ae4b 100644 --- a/src/BaGetter.Core/Metadata/BaGetRegistrationIndexPageItem.cs +++ b/src/BaGetter.Core/Metadata/BaGetRegistrationIndexPageItem.cs @@ -1,7 +1,7 @@ using System.Text.Json.Serialization; using BaGetter.Protocol.Models; -namespace BaGetter.Core; +namespace BaGetter.Core.Metadata; /// /// BaGetter's extensions to a registration index page. diff --git a/src/BaGetter.Core/Metadata/BaGetterPackageMetadata.cs b/src/BaGetter.Core/Metadata/BaGetterPackageMetadata.cs index b880581f1..20831ad85 100644 --- a/src/BaGetter.Core/Metadata/BaGetterPackageMetadata.cs +++ b/src/BaGetter.Core/Metadata/BaGetterPackageMetadata.cs @@ -2,7 +2,7 @@ using System.Text.Json.Serialization; using BaGetter.Protocol.Models; -namespace BaGetter.Core; +namespace BaGetter.Core.Metadata; /// /// BaGetter's extensions to the package metadata model. diff --git a/src/BaGetter.Core/Metadata/BaGetterRegistrationIndexPage.cs b/src/BaGetter.Core/Metadata/BaGetterRegistrationIndexPage.cs index 571eb58e4..d939973e4 100644 --- a/src/BaGetter.Core/Metadata/BaGetterRegistrationIndexPage.cs +++ b/src/BaGetter.Core/Metadata/BaGetterRegistrationIndexPage.cs @@ -2,7 +2,7 @@ using System.Text.Json.Serialization; using BaGetter.Protocol.Models; -namespace BaGetter.Core; +namespace BaGetter.Core.Metadata; /// /// BaGetter's extensions to a registration index page. diff --git a/src/BaGetter.Core/Metadata/BaGetterRegistrationIndexResponse.cs b/src/BaGetter.Core/Metadata/BaGetterRegistrationIndexResponse.cs index 16d0c4079..ba4c6047c 100644 --- a/src/BaGetter.Core/Metadata/BaGetterRegistrationIndexResponse.cs +++ b/src/BaGetter.Core/Metadata/BaGetterRegistrationIndexResponse.cs @@ -2,7 +2,7 @@ using System.Text.Json.Serialization; using BaGetter.Protocol.Models; -namespace BaGetter.Core; +namespace BaGetter.Core.Metadata; /// /// BaGetter's extensions to a registration index response. diff --git a/src/BaGetter.Core/Metadata/DefaultPackageMetadataService.cs b/src/BaGetter.Core/Metadata/DefaultPackageMetadataService.cs index 32ea1be70..d8c58d3a4 100644 --- a/src/BaGetter.Core/Metadata/DefaultPackageMetadataService.cs +++ b/src/BaGetter.Core/Metadata/DefaultPackageMetadataService.cs @@ -5,7 +5,7 @@ using BaGetter.Protocol.Models; using NuGet.Versioning; -namespace BaGetter.Core; +namespace BaGetter.Core.Metadata; /// public class DefaultPackageMetadataService : IPackageMetadataService diff --git a/src/BaGetter.Core/Metadata/IPackageMetadataService.cs b/src/BaGetter.Core/Metadata/IPackageMetadataService.cs index 433c9f40d..14e7cac10 100644 --- a/src/BaGetter.Core/Metadata/IPackageMetadataService.cs +++ b/src/BaGetter.Core/Metadata/IPackageMetadataService.cs @@ -3,7 +3,7 @@ using BaGetter.Protocol.Models; using NuGet.Versioning; -namespace BaGetter.Core; +namespace BaGetter.Core.Metadata; /// /// The Package Metadata client, used to fetch packages' metadata. diff --git a/src/BaGetter.Core/Metadata/PackageRegistration.cs b/src/BaGetter.Core/Metadata/PackageRegistration.cs index 2a2a6ee3f..291550c50 100644 --- a/src/BaGetter.Core/Metadata/PackageRegistration.cs +++ b/src/BaGetter.Core/Metadata/PackageRegistration.cs @@ -1,7 +1,8 @@ using System; using System.Collections.Generic; +using BaGetter.Core.Entities; -namespace BaGetter.Core; +namespace BaGetter.Core.Metadata; /// /// The information on all versions of a package. diff --git a/src/BaGetter.Core/Metadata/RegistrationBuilder.cs b/src/BaGetter.Core/Metadata/RegistrationBuilder.cs index db0388525..6b94c661a 100644 --- a/src/BaGetter.Core/Metadata/RegistrationBuilder.cs +++ b/src/BaGetter.Core/Metadata/RegistrationBuilder.cs @@ -1,9 +1,10 @@ using System; using System.Collections.Generic; using System.Linq; +using BaGetter.Core.Entities; using BaGetter.Protocol.Models; -namespace BaGetter.Core; +namespace BaGetter.Core.Metadata; public class RegistrationBuilder { diff --git a/src/BaGetter.Core/PackageDatabase.cs b/src/BaGetter.Core/PackageDatabase.cs index f860fdba6..c6f454154 100644 --- a/src/BaGetter.Core/PackageDatabase.cs +++ b/src/BaGetter.Core/PackageDatabase.cs @@ -3,6 +3,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Entities; using Microsoft.EntityFrameworkCore; using NuGet.Versioning; diff --git a/src/BaGetter.Core/PackageService.cs b/src/BaGetter.Core/PackageService.cs index b5df07a21..24b2fd4d8 100644 --- a/src/BaGetter.Core/PackageService.cs +++ b/src/BaGetter.Core/PackageService.cs @@ -3,6 +3,9 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Entities; +using BaGetter.Core.Indexing; +using BaGetter.Core.Upstream; using Microsoft.Extensions.Logging; using NuGet.Versioning; diff --git a/src/BaGetter.Core/Search/AutocompleteRequest.cs b/src/BaGetter.Core/Search/AutocompleteRequest.cs index 48ecd819d..1aa94cfc6 100644 --- a/src/BaGetter.Core/Search/AutocompleteRequest.cs +++ b/src/BaGetter.Core/Search/AutocompleteRequest.cs @@ -1,4 +1,4 @@ -namespace BaGetter.Core; +namespace BaGetter.Core.Search; /// /// The NuGet V3 search request. diff --git a/src/BaGetter.Core/Search/DatabaseSearchService.cs b/src/BaGetter.Core/Search/DatabaseSearchService.cs index d07e5ce8f..49121d475 100644 --- a/src/BaGetter.Core/Search/DatabaseSearchService.cs +++ b/src/BaGetter.Core/Search/DatabaseSearchService.cs @@ -3,10 +3,13 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Entities; +using BaGetter.Core.Indexing; +using BaGetter.Core.Metadata; using BaGetter.Protocol.Models; using Microsoft.EntityFrameworkCore; -namespace BaGetter.Core; +namespace BaGetter.Core.Search; public class DatabaseSearchService : ISearchService { diff --git a/src/BaGetter.Core/Search/DependentsResponse.cs b/src/BaGetter.Core/Search/DependentsResponse.cs index 9320e412d..87a25e9e6 100644 --- a/src/BaGetter.Core/Search/DependentsResponse.cs +++ b/src/BaGetter.Core/Search/DependentsResponse.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Text.Json.Serialization; -namespace BaGetter.Core; +namespace BaGetter.Core.Search; /// /// The package ids that depend on the queried package. diff --git a/src/BaGetter.Core/Search/ISearchIndexer.cs b/src/BaGetter.Core/Search/ISearchIndexer.cs index 5823236b0..1f117080d 100644 --- a/src/BaGetter.Core/Search/ISearchIndexer.cs +++ b/src/BaGetter.Core/Search/ISearchIndexer.cs @@ -1,7 +1,8 @@ using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Entities; -namespace BaGetter.Core; +namespace BaGetter.Core.Search; public interface ISearchIndexer { diff --git a/src/BaGetter.Core/Search/ISearchResponseBuilder.cs b/src/BaGetter.Core/Search/ISearchResponseBuilder.cs index f5a97cbd1..1e65c56cb 100644 --- a/src/BaGetter.Core/Search/ISearchResponseBuilder.cs +++ b/src/BaGetter.Core/Search/ISearchResponseBuilder.cs @@ -1,7 +1,8 @@ using System.Collections.Generic; +using BaGetter.Core.Metadata; using BaGetter.Protocol.Models; -namespace BaGetter.Core; +namespace BaGetter.Core.Search; public interface ISearchResponseBuilder { diff --git a/src/BaGetter.Core/Search/ISearchService.cs b/src/BaGetter.Core/Search/ISearchService.cs index 4b59fc7ec..72c8db1d4 100644 --- a/src/BaGetter.Core/Search/ISearchService.cs +++ b/src/BaGetter.Core/Search/ISearchService.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using BaGetter.Protocol.Models; -namespace BaGetter.Core; +namespace BaGetter.Core.Search; /// /// The service used to search for packages. diff --git a/src/BaGetter.Core/Search/NullSearchIndexer.cs b/src/BaGetter.Core/Search/NullSearchIndexer.cs index e4f8c35c9..aa6e937e4 100644 --- a/src/BaGetter.Core/Search/NullSearchIndexer.cs +++ b/src/BaGetter.Core/Search/NullSearchIndexer.cs @@ -1,7 +1,8 @@ using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Entities; -namespace BaGetter.Core; +namespace BaGetter.Core.Search; /// /// A no-op indexer, used when search does not need to index packages. diff --git a/src/BaGetter.Core/Search/NullSearchService.cs b/src/BaGetter.Core/Search/NullSearchService.cs index 2a0a29ea5..b478b7808 100644 --- a/src/BaGetter.Core/Search/NullSearchService.cs +++ b/src/BaGetter.Core/Search/NullSearchService.cs @@ -3,7 +3,7 @@ using System.Threading.Tasks; using BaGetter.Protocol.Models; -namespace BaGetter.Core; +namespace BaGetter.Core.Search; /// /// A minimal search service implementation, used for advanced scenarios. diff --git a/src/BaGetter.Core/Search/SearchRequest.cs b/src/BaGetter.Core/Search/SearchRequest.cs index 528acebf2..b37195ffa 100644 --- a/src/BaGetter.Core/Search/SearchRequest.cs +++ b/src/BaGetter.Core/Search/SearchRequest.cs @@ -1,4 +1,4 @@ -namespace BaGetter.Core; +namespace BaGetter.Core.Search; /// /// The NuGet V3 search request. diff --git a/src/BaGetter.Core/Search/SearchResponseBuilder.cs b/src/BaGetter.Core/Search/SearchResponseBuilder.cs index 7090e34e4..467f6ce4b 100644 --- a/src/BaGetter.Core/Search/SearchResponseBuilder.cs +++ b/src/BaGetter.Core/Search/SearchResponseBuilder.cs @@ -1,9 +1,10 @@ using System; using System.Collections.Generic; using System.Linq; +using BaGetter.Core.Metadata; using BaGetter.Protocol.Models; -namespace BaGetter.Core; +namespace BaGetter.Core.Search; public class SearchResponseBuilder : ISearchResponseBuilder { diff --git a/src/BaGetter.Core/Search/VersionsRequest.cs b/src/BaGetter.Core/Search/VersionsRequest.cs index 455ed064b..8cf57a33b 100644 --- a/src/BaGetter.Core/Search/VersionsRequest.cs +++ b/src/BaGetter.Core/Search/VersionsRequest.cs @@ -1,4 +1,4 @@ -namespace BaGetter.Core; +namespace BaGetter.Core.Search; /// /// The NuGet V3 enumerate package versions request. diff --git a/src/BaGetter.Core/ServiceIndex/BaGetterServiceIndex.cs b/src/BaGetter.Core/ServiceIndex/BaGetterServiceIndex.cs index 4a57f08c8..13d4f1f00 100644 --- a/src/BaGetter.Core/ServiceIndex/BaGetterServiceIndex.cs +++ b/src/BaGetter.Core/ServiceIndex/BaGetterServiceIndex.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; using BaGetter.Protocol.Models; -namespace BaGetter.Core; +namespace BaGetter.Core.ServiceIndex; public class BaGetterServiceIndex : IServiceIndexService { diff --git a/src/BaGetter.Core/ServiceIndex/IServiceIndexService.cs b/src/BaGetter.Core/ServiceIndex/IServiceIndexService.cs index 6fcc8e7cd..d3d713d6a 100644 --- a/src/BaGetter.Core/ServiceIndex/IServiceIndexService.cs +++ b/src/BaGetter.Core/ServiceIndex/IServiceIndexService.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using BaGetter.Protocol.Models; -namespace BaGetter.Core; +namespace BaGetter.Core.ServiceIndex; /// /// The NuGet Service Index service, used to discover other resources. diff --git a/src/BaGetter.Core/Statistics/StatisticsService.cs b/src/BaGetter.Core/Statistics/StatisticsService.cs index 1ffecfbf6..5cab4fe6a 100644 --- a/src/BaGetter.Core/Statistics/StatisticsService.cs +++ b/src/BaGetter.Core/Statistics/StatisticsService.cs @@ -2,6 +2,8 @@ using System.Collections.Generic; using System.Linq; using System.Threading.Tasks; +using BaGetter.Core.Entities; +using BaGetter.Core.Extensions; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Configuration; using Microsoft.Extensions.DependencyInjection; diff --git a/src/BaGetter.Core/Storage/FileStorageService.cs b/src/BaGetter.Core/Storage/FileStorageService.cs index 183866e93..289d331cc 100644 --- a/src/BaGetter.Core/Storage/FileStorageService.cs +++ b/src/BaGetter.Core/Storage/FileStorageService.cs @@ -2,9 +2,11 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Configuration; +using BaGetter.Core.Extensions; using Microsoft.Extensions.Options; -namespace BaGetter.Core; +namespace BaGetter.Core.Storage; /// /// Stores content on disk. diff --git a/src/BaGetter.Core/Storage/IPackageStorageService.cs b/src/BaGetter.Core/Storage/IPackageStorageService.cs index 3cc2ac5b7..0787b7e83 100644 --- a/src/BaGetter.Core/Storage/IPackageStorageService.cs +++ b/src/BaGetter.Core/Storage/IPackageStorageService.cs @@ -1,9 +1,10 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Entities; using NuGet.Versioning; -namespace BaGetter.Core; +namespace BaGetter.Core.Storage; /// /// Stores packages' content. Packages' state are stored by the diff --git a/src/BaGetter.Core/Storage/IStorageService.cs b/src/BaGetter.Core/Storage/IStorageService.cs index 53997e00d..8b047ed4c 100644 --- a/src/BaGetter.Core/Storage/IStorageService.cs +++ b/src/BaGetter.Core/Storage/IStorageService.cs @@ -3,7 +3,7 @@ using System.Threading; using System.Threading.Tasks; -namespace BaGetter.Core; +namespace BaGetter.Core.Storage; /// /// A low-level storage abstraction. diff --git a/src/BaGetter.Core/Storage/ISymbolStorageService.cs b/src/BaGetter.Core/Storage/ISymbolStorageService.cs index 01003a173..604e960db 100644 --- a/src/BaGetter.Core/Storage/ISymbolStorageService.cs +++ b/src/BaGetter.Core/Storage/ISymbolStorageService.cs @@ -2,7 +2,7 @@ using System.Threading; using System.Threading.Tasks; -namespace BaGetter.Core; +namespace BaGetter.Core.Storage; /// /// Stores the content of symbols, also known as PDBs. diff --git a/src/BaGetter.Core/Storage/NullStorageService.cs b/src/BaGetter.Core/Storage/NullStorageService.cs index 10d3ee2af..624fd3613 100644 --- a/src/BaGetter.Core/Storage/NullStorageService.cs +++ b/src/BaGetter.Core/Storage/NullStorageService.cs @@ -3,7 +3,7 @@ using System.Threading; using System.Threading.Tasks; -namespace BaGetter.Core; +namespace BaGetter.Core.Storage; /// /// A minimal storage implementation, used for advanced scenarios. diff --git a/src/BaGetter.Core/Storage/PackageStorageService.cs b/src/BaGetter.Core/Storage/PackageStorageService.cs index fb24ccea2..e5f7e66e8 100644 --- a/src/BaGetter.Core/Storage/PackageStorageService.cs +++ b/src/BaGetter.Core/Storage/PackageStorageService.cs @@ -2,10 +2,11 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Entities; using Microsoft.Extensions.Logging; using NuGet.Versioning; -namespace BaGetter.Core; +namespace BaGetter.Core.Storage; public class PackageStorageService : IPackageStorageService { diff --git a/src/BaGetter.Core/Storage/SymbolStorageService.cs b/src/BaGetter.Core/Storage/SymbolStorageService.cs index 5bd9defbf..0b995e43b 100644 --- a/src/BaGetter.Core/Storage/SymbolStorageService.cs +++ b/src/BaGetter.Core/Storage/SymbolStorageService.cs @@ -4,7 +4,7 @@ using System.Threading; using System.Threading.Tasks; -namespace BaGetter.Core; +namespace BaGetter.Core.Storage; public class SymbolStorageService : ISymbolStorageService { diff --git a/src/BaGetter.Core/Upstream/Clients/DisabledUpstreamClient.cs b/src/BaGetter.Core/Upstream/Clients/DisabledUpstreamClient.cs index 493a7116c..cee389bdc 100644 --- a/src/BaGetter.Core/Upstream/Clients/DisabledUpstreamClient.cs +++ b/src/BaGetter.Core/Upstream/Clients/DisabledUpstreamClient.cs @@ -2,9 +2,10 @@ using System.IO; using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Entities; using NuGet.Versioning; -namespace BaGetter.Core; +namespace BaGetter.Core.Upstream.Clients; /// /// The client used when there are no upstream package sources. diff --git a/src/BaGetter.Core/Upstream/Clients/V2UpstreamClient.cs b/src/BaGetter.Core/Upstream/Clients/V2UpstreamClient.cs index 434bdde3b..943e711b5 100644 --- a/src/BaGetter.Core/Upstream/Clients/V2UpstreamClient.cs +++ b/src/BaGetter.Core/Upstream/Clients/V2UpstreamClient.cs @@ -4,6 +4,8 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Configuration; +using BaGetter.Core.Entities; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using NuGet.Common; @@ -13,7 +15,7 @@ using NuGet.Protocol.Core.Types; using NuGet.Versioning; -namespace BaGetter.Core; +namespace BaGetter.Core.Upstream.Clients; using ILogger = Microsoft.Extensions.Logging.ILogger; using INuGetLogger = NuGet.Common.ILogger; diff --git a/src/BaGetter.Core/Upstream/Clients/V3UpstreamClient.cs b/src/BaGetter.Core/Upstream/Clients/V3UpstreamClient.cs index 20b96c34e..f3a9abbf0 100644 --- a/src/BaGetter.Core/Upstream/Clients/V3UpstreamClient.cs +++ b/src/BaGetter.Core/Upstream/Clients/V3UpstreamClient.cs @@ -4,12 +4,15 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Entities; +using BaGetter.Core.Extensions; using BaGetter.Protocol; +using BaGetter.Protocol.Extensions; using BaGetter.Protocol.Models; using Microsoft.Extensions.Logging; using NuGet.Versioning; -namespace BaGetter.Core; +namespace BaGetter.Core.Upstream.Clients; /// /// The mirroring client for a NuGet server that uses the V3 protocol. diff --git a/src/BaGetter.Core/Upstream/DownloadsImporter.cs b/src/BaGetter.Core/Upstream/DownloadsImporter.cs index a67c20e34..58d1c2fbf 100644 --- a/src/BaGetter.Core/Upstream/DownloadsImporter.cs +++ b/src/BaGetter.Core/Upstream/DownloadsImporter.cs @@ -3,10 +3,11 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Logging; -namespace BaGetter.Core; +namespace BaGetter.Core.Upstream; public class DownloadsImporter { diff --git a/src/BaGetter.Core/Upstream/IPackageDownloadsSource.cs b/src/BaGetter.Core/Upstream/IPackageDownloadsSource.cs index 7ce79c758..453103730 100644 --- a/src/BaGetter.Core/Upstream/IPackageDownloadsSource.cs +++ b/src/BaGetter.Core/Upstream/IPackageDownloadsSource.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; using System.Threading.Tasks; -namespace BaGetter.Core; +namespace BaGetter.Core.Upstream; public interface IPackageDownloadsSource { diff --git a/src/BaGetter.Core/Upstream/IUpstreamClient.cs b/src/BaGetter.Core/Upstream/IUpstreamClient.cs index 80458bf12..1252c58cc 100644 --- a/src/BaGetter.Core/Upstream/IUpstreamClient.cs +++ b/src/BaGetter.Core/Upstream/IUpstreamClient.cs @@ -1,10 +1,11 @@ -using NuGet.Versioning; -using System.Collections.Generic; +using System.Collections.Generic; using System.IO; using System.Threading; using System.Threading.Tasks; +using BaGetter.Core.Entities; +using NuGet.Versioning; -namespace BaGetter.Core; +namespace BaGetter.Core.Upstream; /// /// A client to interact with an upstream package source. diff --git a/src/BaGetter.Core/Upstream/PackageDownloadsJsonSource.cs b/src/BaGetter.Core/Upstream/PackageDownloadsJsonSource.cs index 2032da48c..5c4de6070 100644 --- a/src/BaGetter.Core/Upstream/PackageDownloadsJsonSource.cs +++ b/src/BaGetter.Core/Upstream/PackageDownloadsJsonSource.cs @@ -9,7 +9,7 @@ using Newtonsoft.Json.Linq; using NuGet.Versioning; -namespace BaGetter.Core; +namespace BaGetter.Core.Upstream; /// See: public class PackageDownloadsJsonSource : IPackageDownloadsSource diff --git a/src/BaGetter.Core/Validation/RequiredIfAttribute.cs b/src/BaGetter.Core/Validation/RequiredIfAttribute.cs index 0d5ccea76..3d603ab2c 100644 --- a/src/BaGetter.Core/Validation/RequiredIfAttribute.cs +++ b/src/BaGetter.Core/Validation/RequiredIfAttribute.cs @@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations; using System.Globalization; -namespace BaGetter.Core; +namespace BaGetter.Core.Validation; /// /// Provides conditional validation based on related property value. diff --git a/src/BaGetter.Core/Validation/ValidateBaGetOptions.cs b/src/BaGetter.Core/Validation/ValidateBaGetOptions.cs index 8f160e434..5d2548ef3 100644 --- a/src/BaGetter.Core/Validation/ValidateBaGetOptions.cs +++ b/src/BaGetter.Core/Validation/ValidateBaGetOptions.cs @@ -2,7 +2,7 @@ using System.ComponentModel.DataAnnotations; using Microsoft.Extensions.Options; -namespace BaGetter.Core; +namespace BaGetter.Core.Validation; /// /// A configuration that validates options using data annotations. diff --git a/src/BaGetter.Core/Validation/ValidateStartupOptions.cs b/src/BaGetter.Core/Validation/ValidateStartupOptions.cs index 80a1421ba..de5e27286 100644 --- a/src/BaGetter.Core/Validation/ValidateStartupOptions.cs +++ b/src/BaGetter.Core/Validation/ValidateStartupOptions.cs @@ -1,8 +1,9 @@ using System; +using BaGetter.Core.Configuration; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -namespace BaGetter.Core; +namespace BaGetter.Core.Validation; /// /// Validates BaGetter's options, used at startup. diff --git a/src/BaGetter.Database.MySql/BaGetter.Database.MySql.csproj b/src/BaGetter.Database.MySql/BaGetter.Database.MySql.csproj index a340335f7..26e9cbef8 100644 --- a/src/BaGetter.Database.MySql/BaGetter.Database.MySql.csproj +++ b/src/BaGetter.Database.MySql/BaGetter.Database.MySql.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 latest NuGet The libraries to host BaGetter on MySQL. diff --git a/src/BaGetter.Database.MySql/MySqlApplicationExtensions.cs b/src/BaGetter.Database.MySql/MySqlApplicationExtensions.cs index 17fccdc64..a9628cab4 100644 --- a/src/BaGetter.Database.MySql/MySqlApplicationExtensions.cs +++ b/src/BaGetter.Database.MySql/MySqlApplicationExtensions.cs @@ -1,9 +1,10 @@ using System; using BaGetter.Core; -using BaGetter.Database.MySql; +using BaGetter.Core.Configuration; +using BaGetter.Core.Extensions; using Microsoft.Extensions.DependencyInjection; -namespace BaGetter; +namespace BaGetter.Database.MySql; public static class MySqlApplicationExtensions { diff --git a/src/BaGetter.Database.MySql/MySqlContext.cs b/src/BaGetter.Database.MySql/MySqlContext.cs index 8d26078dc..5cd2f37a3 100644 --- a/src/BaGetter.Database.MySql/MySqlContext.cs +++ b/src/BaGetter.Database.MySql/MySqlContext.cs @@ -1,4 +1,5 @@ -using BaGetter.Core; +using BaGetter.Core.Configuration; +using BaGetter.Core.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Options; using MySqlConnector; diff --git a/src/BaGetter.Database.PostgreSql/BaGetter.Database.PostgreSql.csproj b/src/BaGetter.Database.PostgreSql/BaGetter.Database.PostgreSql.csproj index b0a859043..b618c4ec8 100644 --- a/src/BaGetter.Database.PostgreSql/BaGetter.Database.PostgreSql.csproj +++ b/src/BaGetter.Database.PostgreSql/BaGetter.Database.PostgreSql.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 NuGet The libraries to host BaGetter on PostgreSQL. diff --git a/src/BaGetter.Database.PostgreSql/PostgreSqlApplicationExtensions.cs b/src/BaGetter.Database.PostgreSql/PostgreSqlApplicationExtensions.cs index 7b34332a8..f80d8841e 100644 --- a/src/BaGetter.Database.PostgreSql/PostgreSqlApplicationExtensions.cs +++ b/src/BaGetter.Database.PostgreSql/PostgreSqlApplicationExtensions.cs @@ -1,9 +1,10 @@ using System; using BaGetter.Core; -using BaGetter.Database.PostgreSql; +using BaGetter.Core.Configuration; +using BaGetter.Core.Extensions; using Microsoft.Extensions.DependencyInjection; -namespace BaGetter; +namespace BaGetter.Database.PostgreSql; public static class PostgreSqlApplicationExtensions { diff --git a/src/BaGetter.Database.PostgreSql/PostgreSqlContext.cs b/src/BaGetter.Database.PostgreSql/PostgreSqlContext.cs index 36882769f..fddc965ba 100644 --- a/src/BaGetter.Database.PostgreSql/PostgreSqlContext.cs +++ b/src/BaGetter.Database.PostgreSql/PostgreSqlContext.cs @@ -1,6 +1,7 @@ using System.Threading; using System.Threading.Tasks; -using BaGetter.Core; +using BaGetter.Core.Configuration; +using BaGetter.Core.Entities; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Options; using Npgsql; diff --git a/src/BaGetter.Database.SqlServer/BaGetter.Database.SqlServer.csproj b/src/BaGetter.Database.SqlServer/BaGetter.Database.SqlServer.csproj index a4314e332..cb093a386 100644 --- a/src/BaGetter.Database.SqlServer/BaGetter.Database.SqlServer.csproj +++ b/src/BaGetter.Database.SqlServer/BaGetter.Database.SqlServer.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 NuGet The libraries to host BaGetter on SQL Server. diff --git a/src/BaGetter.Database.SqlServer/SqlServerApplicationExtensions.cs b/src/BaGetter.Database.SqlServer/SqlServerApplicationExtensions.cs index 0fa4774d5..ee7d41897 100644 --- a/src/BaGetter.Database.SqlServer/SqlServerApplicationExtensions.cs +++ b/src/BaGetter.Database.SqlServer/SqlServerApplicationExtensions.cs @@ -1,9 +1,10 @@ using System; using BaGetter.Core; -using BaGetter.Database.SqlServer; +using BaGetter.Core.Configuration; +using BaGetter.Core.Extensions; using Microsoft.Extensions.DependencyInjection; -namespace BaGetter; +namespace BaGetter.Database.SqlServer; public static class SqlServerApplicationExtensions { diff --git a/src/BaGetter.Database.SqlServer/SqlServerContext.cs b/src/BaGetter.Database.SqlServer/SqlServerContext.cs index 36c7964bc..893a0681c 100644 --- a/src/BaGetter.Database.SqlServer/SqlServerContext.cs +++ b/src/BaGetter.Database.SqlServer/SqlServerContext.cs @@ -1,5 +1,6 @@ using System.Linq; -using BaGetter.Core; +using BaGetter.Core.Configuration; +using BaGetter.Core.Entities; using Microsoft.Data.SqlClient; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Options; diff --git a/src/BaGetter.Database.Sqlite/BaGetter.Database.Sqlite.csproj b/src/BaGetter.Database.Sqlite/BaGetter.Database.Sqlite.csproj index 87fb4d009..b0c770131 100644 --- a/src/BaGetter.Database.Sqlite/BaGetter.Database.Sqlite.csproj +++ b/src/BaGetter.Database.Sqlite/BaGetter.Database.Sqlite.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 enable NuGet The libraries to host BaGetter on SQLite. diff --git a/src/BaGetter.Database.Sqlite/SqliteApplicationExtensions.cs b/src/BaGetter.Database.Sqlite/SqliteApplicationExtensions.cs index a9e6db146..ec0ba604f 100644 --- a/src/BaGetter.Database.Sqlite/SqliteApplicationExtensions.cs +++ b/src/BaGetter.Database.Sqlite/SqliteApplicationExtensions.cs @@ -1,9 +1,10 @@ using System; using BaGetter.Core; -using BaGetter.Database.Sqlite; +using BaGetter.Core.Configuration; +using BaGetter.Core.Extensions; using Microsoft.Extensions.DependencyInjection; -namespace BaGetter; +namespace BaGetter.Database.Sqlite; public static class SqliteApplicationExtensions { diff --git a/src/BaGetter.Database.Sqlite/SqliteContext.cs b/src/BaGetter.Database.Sqlite/SqliteContext.cs index 5e70a2b66..fdeec5141 100644 --- a/src/BaGetter.Database.Sqlite/SqliteContext.cs +++ b/src/BaGetter.Database.Sqlite/SqliteContext.cs @@ -1,7 +1,8 @@ using System.IO; using System.Threading; using System.Threading.Tasks; -using BaGetter.Core; +using BaGetter.Core.Configuration; +using BaGetter.Core.Entities; using Microsoft.Data.Sqlite; using Microsoft.EntityFrameworkCore; using Microsoft.Extensions.Options; diff --git a/src/BaGetter.Gcp/BaGetter.Gcp.csproj b/src/BaGetter.Gcp/BaGetter.Gcp.csproj index 05c2945a1..7be090f61 100644 --- a/src/BaGetter.Gcp/BaGetter.Gcp.csproj +++ b/src/BaGetter.Gcp/BaGetter.Gcp.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 NuGet;Google;Cloud The libraries to host BaGetter on the Google Cloud Platform. diff --git a/src/BaGetter.Gcp/GoogleCloudApplicationExtensions.cs b/src/BaGetter.Gcp/GoogleCloudApplicationExtensions.cs index 6354bef98..778030da6 100644 --- a/src/BaGetter.Gcp/GoogleCloudApplicationExtensions.cs +++ b/src/BaGetter.Gcp/GoogleCloudApplicationExtensions.cs @@ -1,10 +1,12 @@ using System; using BaGetter.Core; -using BaGetter.Gcp; +using BaGetter.Core.Configuration; +using BaGetter.Core.Extensions; +using BaGetter.Core.Storage; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; -namespace BaGetter; +namespace BaGetter.Gcp; public static class GoogleCloudApplicationExtensions { diff --git a/src/BaGetter.Gcp/GoogleCloudStorageOptions.cs b/src/BaGetter.Gcp/GoogleCloudStorageOptions.cs index a2ebceff3..861a4a628 100644 --- a/src/BaGetter.Gcp/GoogleCloudStorageOptions.cs +++ b/src/BaGetter.Gcp/GoogleCloudStorageOptions.cs @@ -1,5 +1,5 @@ using System.ComponentModel.DataAnnotations; -using BaGetter.Core; +using BaGetter.Core.Configuration; namespace BaGetter.Gcp; diff --git a/src/BaGetter.Gcp/GoogleCloudStorageService.cs b/src/BaGetter.Gcp/GoogleCloudStorageService.cs index 583a6c043..783b394fa 100644 --- a/src/BaGetter.Gcp/GoogleCloudStorageService.cs +++ b/src/BaGetter.Gcp/GoogleCloudStorageService.cs @@ -1,11 +1,10 @@ using System; using System.IO; -using System.Linq; using System.Net; using System.Security.Cryptography; using System.Threading; using System.Threading.Tasks; -using BaGetter.Core; +using BaGetter.Core.Storage; using Google; using Google.Cloud.Storage.V1; using Microsoft.Extensions.Options; diff --git a/src/BaGetter.Protocol/BaGetter.Protocol.csproj b/src/BaGetter.Protocol/BaGetter.Protocol.csproj index c1a4d64da..f7b19c1b5 100644 --- a/src/BaGetter.Protocol/BaGetter.Protocol.csproj +++ b/src/BaGetter.Protocol/BaGetter.Protocol.csproj @@ -1,7 +1,7 @@ - netstandard2.0 + net10.0 NuGet;Protocol Libraries to interact with NuGet server APIs. diff --git a/src/BaGetter.Protocol/Catalog/CatalogClient.cs b/src/BaGetter.Protocol/Catalog/CatalogClient.cs index 37032c9fe..f56107ed8 100644 --- a/src/BaGetter.Protocol/Catalog/CatalogClient.cs +++ b/src/BaGetter.Protocol/Catalog/CatalogClient.cs @@ -1,8 +1,10 @@ using System; using System.Threading; using System.Threading.Tasks; +using BaGetter.Protocol.Catalog; using BaGetter.Protocol.Models; +// ReSharper disable once CheckNamespace namespace BaGetter.Protocol; public partial class NuGetClientFactory diff --git a/src/BaGetter.Protocol/Catalog/CatalogProcessor.cs b/src/BaGetter.Protocol/Catalog/CatalogProcessor.cs index 0c45f11e2..cea47ece9 100644 --- a/src/BaGetter.Protocol/Catalog/CatalogProcessor.cs +++ b/src/BaGetter.Protocol/Catalog/CatalogProcessor.cs @@ -1,6 +1,7 @@ using System; using System.Threading; using System.Threading.Tasks; +using BaGetter.Protocol.Extensions; using BaGetter.Protocol.Models; using Microsoft.Extensions.Logging; @@ -188,8 +189,7 @@ private async Task GetMinCommitTimestamp(CancellationToken cance { var minCommitTimestamp = await _cursor.GetAsync(cancellationToken); - minCommitTimestamp = minCommitTimestamp - ?? _options.DefaultMinCommitTimestamp + minCommitTimestamp ??= _options.DefaultMinCommitTimestamp ?? _options.MinCommitTimestamp; if (minCommitTimestamp.Value < _options.MinCommitTimestamp) diff --git a/src/BaGetter.Protocol/Catalog/ICatalogClient.cs b/src/BaGetter.Protocol/Catalog/ICatalogClient.cs index 26f951792..83d38da41 100644 --- a/src/BaGetter.Protocol/Catalog/ICatalogClient.cs +++ b/src/BaGetter.Protocol/Catalog/ICatalogClient.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using BaGetter.Protocol.Models; -namespace BaGetter.Protocol; +namespace BaGetter.Protocol.Catalog; /// /// The Catalog client, used to discover package events.
diff --git a/src/BaGetter.Protocol/Catalog/NullCatalogClient.cs b/src/BaGetter.Protocol/Catalog/NullCatalogClient.cs index 634975ad1..3526552ed 100644 --- a/src/BaGetter.Protocol/Catalog/NullCatalogClient.cs +++ b/src/BaGetter.Protocol/Catalog/NullCatalogClient.cs @@ -4,7 +4,7 @@ using System.Threading.Tasks; using BaGetter.Protocol.Models; -namespace BaGetter.Protocol.Internal; +namespace BaGetter.Protocol.Catalog; public class NullCatalogClient : ICatalogClient { diff --git a/src/BaGetter.Protocol/Catalog/RawCatalogClient.cs b/src/BaGetter.Protocol/Catalog/RawCatalogClient.cs index bb95f6a54..069aed41e 100644 --- a/src/BaGetter.Protocol/Catalog/RawCatalogClient.cs +++ b/src/BaGetter.Protocol/Catalog/RawCatalogClient.cs @@ -3,9 +3,10 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using BaGetter.Protocol.Extensions; using BaGetter.Protocol.Models; -namespace BaGetter.Protocol.Internal; +namespace BaGetter.Protocol.Catalog; public class RawCatalogClient : ICatalogClient { diff --git a/src/BaGetter.Protocol/Converters/PackageDependencyRangeJsonConverter.cs b/src/BaGetter.Protocol/Converters/PackageDependencyRangeJsonConverter.cs index 1a1a357e7..b9c65796c 100644 --- a/src/BaGetter.Protocol/Converters/PackageDependencyRangeJsonConverter.cs +++ b/src/BaGetter.Protocol/Converters/PackageDependencyRangeJsonConverter.cs @@ -2,7 +2,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace BaGetter.Protocol.Internal; +namespace BaGetter.Protocol.Converters; /// /// This is an internal API that may be changed or removed without notice in any release. diff --git a/src/BaGetter.Protocol/Converters/StringOrStringArrayJsonConverter.cs b/src/BaGetter.Protocol/Converters/StringOrStringArrayJsonConverter.cs index f30c3ac7f..c4f5e0b7e 100644 --- a/src/BaGetter.Protocol/Converters/StringOrStringArrayJsonConverter.cs +++ b/src/BaGetter.Protocol/Converters/StringOrStringArrayJsonConverter.cs @@ -3,7 +3,7 @@ using System.Text.Json; using System.Text.Json.Serialization; -namespace BaGetter.Protocol.Internal; +namespace BaGetter.Protocol.Converters; /// /// This is an internal API that may be changed or removed without notice in any release. diff --git a/src/BaGetter.Protocol/Extensions/CatalogModelExtensions.cs b/src/BaGetter.Protocol/Extensions/CatalogModelExtensions.cs index b4ebf3360..9239b56ae 100644 --- a/src/BaGetter.Protocol/Extensions/CatalogModelExtensions.cs +++ b/src/BaGetter.Protocol/Extensions/CatalogModelExtensions.cs @@ -5,7 +5,7 @@ using NuGet.Frameworks; using NuGet.Versioning; -namespace BaGetter.Protocol; +namespace BaGetter.Protocol.Extensions; /// /// These are documented interpretations of values returned by the catalog API. diff --git a/src/BaGetter.Protocol/Extensions/HttpClientExtensions.cs b/src/BaGetter.Protocol/Extensions/HttpClientExtensions.cs index 85a3049a8..b16273768 100644 --- a/src/BaGetter.Protocol/Extensions/HttpClientExtensions.cs +++ b/src/BaGetter.Protocol/Extensions/HttpClientExtensions.cs @@ -4,7 +4,7 @@ using System.Threading; using System.Threading.Tasks; -namespace BaGetter.Protocol; +namespace BaGetter.Protocol.Extensions; internal static class HttpClientExtensions { diff --git a/src/BaGetter.Protocol/Extensions/NuGetClientFactoryExtensions.cs b/src/BaGetter.Protocol/Extensions/NuGetClientFactoryExtensions.cs index 1485da4f6..dfded7482 100644 --- a/src/BaGetter.Protocol/Extensions/NuGetClientFactoryExtensions.cs +++ b/src/BaGetter.Protocol/Extensions/NuGetClientFactoryExtensions.cs @@ -1,7 +1,7 @@ using BaGetter.Protocol.Catalog; using Microsoft.Extensions.Logging; -namespace BaGetter.Protocol; +namespace BaGetter.Protocol.Extensions; public static class NuGetClientFactoryExtensions { diff --git a/src/BaGetter.Protocol/Extensions/PackageContentModelExtensions.cs b/src/BaGetter.Protocol/Extensions/PackageContentModelExtensions.cs index b8fe31cdf..7adb5040a 100644 --- a/src/BaGetter.Protocol/Extensions/PackageContentModelExtensions.cs +++ b/src/BaGetter.Protocol/Extensions/PackageContentModelExtensions.cs @@ -3,7 +3,7 @@ using BaGetter.Protocol.Models; using NuGet.Versioning; -namespace BaGetter.Protocol; +namespace BaGetter.Protocol.Extensions; /// /// These are documented interpretations of values returned by the Package Content resource. diff --git a/src/BaGetter.Protocol/Extensions/PackageMetadataModelExtensions.cs b/src/BaGetter.Protocol/Extensions/PackageMetadataModelExtensions.cs index 055aebbb9..e2a6a5e8d 100644 --- a/src/BaGetter.Protocol/Extensions/PackageMetadataModelExtensions.cs +++ b/src/BaGetter.Protocol/Extensions/PackageMetadataModelExtensions.cs @@ -1,7 +1,7 @@ using BaGetter.Protocol.Models; using NuGet.Versioning; -namespace BaGetter.Protocol; +namespace BaGetter.Protocol.Extensions; /// /// These are documented interpretations of values returned by the @@ -14,7 +14,7 @@ public static class RegistrationModelExtensions /// /// The package metadata. /// The package version. - public static NuGetVersion ParseVersion(this PackageMetadata package) + public static NuGetVersion ParseVersion(this Models.PackageMetadata package) { return NuGetVersion.Parse(package.Version); } @@ -24,7 +24,7 @@ public static NuGetVersion ParseVersion(this PackageMetadata package) /// /// The package metadata. /// True if the package is listed. - public static bool IsListed(this PackageMetadata package) + public static bool IsListed(this Models.PackageMetadata package) { if (package.Listed.HasValue) { diff --git a/src/BaGetter.Protocol/Extensions/SearchModelExtensions.cs b/src/BaGetter.Protocol/Extensions/SearchModelExtensions.cs index 3ef730eb3..82752f7ff 100644 --- a/src/BaGetter.Protocol/Extensions/SearchModelExtensions.cs +++ b/src/BaGetter.Protocol/Extensions/SearchModelExtensions.cs @@ -1,7 +1,7 @@ using BaGetter.Protocol.Models; using NuGet.Versioning; -namespace BaGetter.Protocol; +namespace BaGetter.Protocol.Extensions; /// /// These are documented interpretations of values returned by the Search resource. diff --git a/src/BaGetter.Protocol/Extensions/ServiceIndexModelExtensions.cs b/src/BaGetter.Protocol/Extensions/ServiceIndexModelExtensions.cs index b6f0bed0c..b8913c257 100644 --- a/src/BaGetter.Protocol/Extensions/ServiceIndexModelExtensions.cs +++ b/src/BaGetter.Protocol/Extensions/ServiceIndexModelExtensions.cs @@ -2,7 +2,7 @@ using System.Linq; using BaGetter.Protocol.Models; -namespace BaGetter.Protocol; +namespace BaGetter.Protocol.Extensions; /// /// These are documented interpretations of values returned by the Service Index resource. diff --git a/src/BaGetter.Protocol/Models/DependencyItem.cs b/src/BaGetter.Protocol/Models/DependencyItem.cs index d25316c8f..4b31a3482 100644 --- a/src/BaGetter.Protocol/Models/DependencyItem.cs +++ b/src/BaGetter.Protocol/Models/DependencyItem.cs @@ -1,5 +1,5 @@ using System.Text.Json.Serialization; -using BaGetter.Protocol.Internal; +using BaGetter.Protocol.Converters; namespace BaGetter.Protocol.Models; diff --git a/src/BaGetter.Protocol/Models/PackageMetadata.cs b/src/BaGetter.Protocol/Models/PackageMetadata.cs index ddd1bca8e..7e835bdf0 100644 --- a/src/BaGetter.Protocol/Models/PackageMetadata.cs +++ b/src/BaGetter.Protocol/Models/PackageMetadata.cs @@ -1,7 +1,7 @@ using System; using System.Collections.Generic; using System.Text.Json.Serialization; -using BaGetter.Protocol.Internal; +using BaGetter.Protocol.Converters; namespace BaGetter.Protocol.Models; diff --git a/src/BaGetter.Protocol/Models/SearchResult.cs b/src/BaGetter.Protocol/Models/SearchResult.cs index 8e5782863..9a7a5b8c2 100644 --- a/src/BaGetter.Protocol/Models/SearchResult.cs +++ b/src/BaGetter.Protocol/Models/SearchResult.cs @@ -1,6 +1,6 @@ using System.Collections.Generic; using System.Text.Json.Serialization; -using BaGetter.Protocol.Internal; +using BaGetter.Protocol.Converters; namespace BaGetter.Protocol.Models; diff --git a/src/BaGetter.Protocol/NuGetClient.cs b/src/BaGetter.Protocol/NuGetClient.cs index 50cb305e9..b0760963a 100644 --- a/src/BaGetter.Protocol/NuGetClient.cs +++ b/src/BaGetter.Protocol/NuGetClient.cs @@ -6,7 +6,11 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using BaGetter.Protocol.Extensions; using BaGetter.Protocol.Models; +using BaGetter.Protocol.PackageContent; +using BaGetter.Protocol.PackageMetadata; +using BaGetter.Protocol.Search; using NuGet.Versioning; namespace BaGetter.Protocol; @@ -166,8 +170,8 @@ public virtual async Task> ListPackageVersionsAsync( var packages = await GetPackageMetadataAsync(packageId, cancellationToken); return packages - .Where(p => p.IsListed()) - .Select(p => p.ParseVersion()) + .Where(p => RegistrationModelExtensions.IsListed(p)) + .Select(p => RegistrationModelExtensions.ParseVersion(p)) .ToList(); } @@ -204,11 +208,11 @@ public virtual async Task> ListPackageVersionsAsync( /// The package ID. /// A token to cancel the task. /// The package's metadata, or an empty list if the package does not exist. - public virtual async Task> GetPackageMetadataAsync( + public virtual async Task> GetPackageMetadataAsync( string packageId, CancellationToken cancellationToken = default) { - var result = new List(); + var result = new List(); var registrationIndex = await _metadataClient.GetRegistrationIndexOrNullAsync(packageId, cancellationToken); @@ -251,7 +255,7 @@ public virtual async Task> GetPackageMetadataAsyn /// /// The package could not be found. /// - public virtual async Task GetPackageMetadataAsync( + public virtual async Task GetPackageMetadataAsync( string packageId, NuGetVersion packageVersion, CancellationToken cancellationToken = default) diff --git a/src/BaGetter.Protocol/NuGetClientFactory.cs b/src/BaGetter.Protocol/NuGetClientFactory.cs index 1ac4f41e2..85a7e8eea 100644 --- a/src/BaGetter.Protocol/NuGetClientFactory.cs +++ b/src/BaGetter.Protocol/NuGetClientFactory.cs @@ -2,8 +2,13 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; -using BaGetter.Protocol.Internal; +using BaGetter.Protocol.Catalog; +using BaGetter.Protocol.Extensions; using BaGetter.Protocol.Models; +using BaGetter.Protocol.PackageContent; +using BaGetter.Protocol.PackageMetadata; +using BaGetter.Protocol.Search; +using BaGetter.Protocol.ServiceIndex; namespace BaGetter.Protocol; diff --git a/src/BaGetter.Protocol/PackageContent/IPackageContentClient.cs b/src/BaGetter.Protocol/PackageContent/IPackageContentClient.cs index e87c68f63..535540185 100644 --- a/src/BaGetter.Protocol/PackageContent/IPackageContentClient.cs +++ b/src/BaGetter.Protocol/PackageContent/IPackageContentClient.cs @@ -4,7 +4,7 @@ using BaGetter.Protocol.Models; using NuGet.Versioning; -namespace BaGetter.Protocol; +namespace BaGetter.Protocol.PackageContent; /// /// The Package Content resource, used to download NuGet packages and to fetch other metadata. diff --git a/src/BaGetter.Protocol/PackageContent/PackageContentClient.cs b/src/BaGetter.Protocol/PackageContent/PackageContentClient.cs index e6391e97c..24e65931e 100644 --- a/src/BaGetter.Protocol/PackageContent/PackageContentClient.cs +++ b/src/BaGetter.Protocol/PackageContent/PackageContentClient.cs @@ -3,8 +3,10 @@ using System.Threading; using System.Threading.Tasks; using BaGetter.Protocol.Models; +using BaGetter.Protocol.PackageContent; using NuGet.Versioning; +// ReSharper disable once CheckNamespace namespace BaGetter.Protocol; public partial class NuGetClientFactory diff --git a/src/BaGetter.Protocol/PackageContent/RawPackageContentClient.cs b/src/BaGetter.Protocol/PackageContent/RawPackageContentClient.cs index e68b30521..f6f3d7afd 100644 --- a/src/BaGetter.Protocol/PackageContent/RawPackageContentClient.cs +++ b/src/BaGetter.Protocol/PackageContent/RawPackageContentClient.cs @@ -4,10 +4,11 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using BaGetter.Protocol.Extensions; using BaGetter.Protocol.Models; using NuGet.Versioning; -namespace BaGetter.Protocol.Internal; +namespace BaGetter.Protocol.PackageContent; /// /// The client to interact with an upstream source's Package Content resource. diff --git a/src/BaGetter.Protocol/PackageMetadata/IPackageMetadataClient.cs b/src/BaGetter.Protocol/PackageMetadata/IPackageMetadataClient.cs index 0f968e40f..5865eb7dd 100644 --- a/src/BaGetter.Protocol/PackageMetadata/IPackageMetadataClient.cs +++ b/src/BaGetter.Protocol/PackageMetadata/IPackageMetadataClient.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using BaGetter.Protocol.Models; -namespace BaGetter.Protocol; +namespace BaGetter.Protocol.PackageMetadata; /// /// The Package Metadata client, used to fetch packages' metadata. diff --git a/src/BaGetter.Protocol/PackageMetadata/PackageMetadataClient.cs b/src/BaGetter.Protocol/PackageMetadata/PackageMetadataClient.cs index 060bc9865..ae09fd510 100644 --- a/src/BaGetter.Protocol/PackageMetadata/PackageMetadataClient.cs +++ b/src/BaGetter.Protocol/PackageMetadata/PackageMetadataClient.cs @@ -2,7 +2,9 @@ using System.Threading; using System.Threading.Tasks; using BaGetter.Protocol.Models; +using BaGetter.Protocol.PackageMetadata; +// ReSharper disable once CheckNamespace namespace BaGetter.Protocol; public partial class NuGetClientFactory diff --git a/src/BaGetter.Protocol/PackageMetadata/RawPackageMetadataClient.cs b/src/BaGetter.Protocol/PackageMetadata/RawPackageMetadataClient.cs index a9ddf7f79..cebcc5099 100644 --- a/src/BaGetter.Protocol/PackageMetadata/RawPackageMetadataClient.cs +++ b/src/BaGetter.Protocol/PackageMetadata/RawPackageMetadataClient.cs @@ -2,9 +2,10 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using BaGetter.Protocol.Extensions; using BaGetter.Protocol.Models; -namespace BaGetter.Protocol.Internal; +namespace BaGetter.Protocol.PackageMetadata; /// /// The client to interact with an upstream source's Package Metadata resource. diff --git a/src/BaGetter.Protocol/Search/AutocompleteClient.cs b/src/BaGetter.Protocol/Search/AutocompleteClient.cs index a6811b849..eb71087fe 100644 --- a/src/BaGetter.Protocol/Search/AutocompleteClient.cs +++ b/src/BaGetter.Protocol/Search/AutocompleteClient.cs @@ -2,7 +2,9 @@ using System.Threading; using System.Threading.Tasks; using BaGetter.Protocol.Models; +using BaGetter.Protocol.Search; +// ReSharper disable once CheckNamespace namespace BaGetter.Protocol; public partial class NuGetClientFactory diff --git a/src/BaGetter.Protocol/Search/IAutocompleteClient.cs b/src/BaGetter.Protocol/Search/IAutocompleteClient.cs index ce64544c3..308df51f2 100644 --- a/src/BaGetter.Protocol/Search/IAutocompleteClient.cs +++ b/src/BaGetter.Protocol/Search/IAutocompleteClient.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using BaGetter.Protocol.Models; -namespace BaGetter.Protocol; +namespace BaGetter.Protocol.Search; /// /// The client used to search for packages. diff --git a/src/BaGetter.Protocol/Search/ISearchClient.cs b/src/BaGetter.Protocol/Search/ISearchClient.cs index d77fbbbb7..daaf4cd7c 100644 --- a/src/BaGetter.Protocol/Search/ISearchClient.cs +++ b/src/BaGetter.Protocol/Search/ISearchClient.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using BaGetter.Protocol.Models; -namespace BaGetter.Protocol; +namespace BaGetter.Protocol.Search; /// /// The client used to search for packages. diff --git a/src/BaGetter.Protocol/Search/NullAutocompleteClient.cs b/src/BaGetter.Protocol/Search/NullAutocompleteClient.cs index 8f7abf352..157533570 100644 --- a/src/BaGetter.Protocol/Search/NullAutocompleteClient.cs +++ b/src/BaGetter.Protocol/Search/NullAutocompleteClient.cs @@ -3,7 +3,7 @@ using System.Threading.Tasks; using BaGetter.Protocol.Models; -namespace BaGetter.Protocol.Internal; +namespace BaGetter.Protocol.Search; public class NullAutocompleteClient : IAutocompleteClient { diff --git a/src/BaGetter.Protocol/Search/RawAutocompleteClient.cs b/src/BaGetter.Protocol/Search/RawAutocompleteClient.cs index 190b79b7d..6f04a2226 100644 --- a/src/BaGetter.Protocol/Search/RawAutocompleteClient.cs +++ b/src/BaGetter.Protocol/Search/RawAutocompleteClient.cs @@ -2,9 +2,10 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using BaGetter.Protocol.Extensions; using BaGetter.Protocol.Models; -namespace BaGetter.Protocol.Internal; +namespace BaGetter.Protocol.Search; /// /// The client used to search for packages. diff --git a/src/BaGetter.Protocol/Search/RawSearchClient.cs b/src/BaGetter.Protocol/Search/RawSearchClient.cs index 49e33439a..a366bc0a0 100644 --- a/src/BaGetter.Protocol/Search/RawSearchClient.cs +++ b/src/BaGetter.Protocol/Search/RawSearchClient.cs @@ -4,9 +4,10 @@ using System.Text; using System.Threading; using System.Threading.Tasks; +using BaGetter.Protocol.Extensions; using BaGetter.Protocol.Models; -namespace BaGetter.Protocol.Internal; +namespace BaGetter.Protocol.Search; /// /// The client used to search for packages. diff --git a/src/BaGetter.Protocol/Search/SearchClient.cs b/src/BaGetter.Protocol/Search/SearchClient.cs index 43dac75ab..d989f5932 100644 --- a/src/BaGetter.Protocol/Search/SearchClient.cs +++ b/src/BaGetter.Protocol/Search/SearchClient.cs @@ -2,7 +2,9 @@ using System.Threading; using System.Threading.Tasks; using BaGetter.Protocol.Models; +using BaGetter.Protocol.Search; +// ReSharper disable once CheckNamespace namespace BaGetter.Protocol; public partial class NuGetClientFactory diff --git a/src/BaGetter.Protocol/ServiceIndex/IServiceIndexClient.cs b/src/BaGetter.Protocol/ServiceIndex/IServiceIndexClient.cs index b119761ec..0b4246f70 100644 --- a/src/BaGetter.Protocol/ServiceIndex/IServiceIndexClient.cs +++ b/src/BaGetter.Protocol/ServiceIndex/IServiceIndexClient.cs @@ -2,7 +2,7 @@ using System.Threading.Tasks; using BaGetter.Protocol.Models; -namespace BaGetter.Protocol; +namespace BaGetter.Protocol.ServiceIndex; /// /// The NuGet Service Index client, used to discover other resources. diff --git a/src/BaGetter.Protocol/ServiceIndex/RawServiceIndexClient.cs b/src/BaGetter.Protocol/ServiceIndex/RawServiceIndexClient.cs index 33d4b1a0c..4d84345e0 100644 --- a/src/BaGetter.Protocol/ServiceIndex/RawServiceIndexClient.cs +++ b/src/BaGetter.Protocol/ServiceIndex/RawServiceIndexClient.cs @@ -2,9 +2,10 @@ using System.Net.Http; using System.Threading; using System.Threading.Tasks; +using BaGetter.Protocol.Extensions; using BaGetter.Protocol.Models; -namespace BaGetter.Protocol.Internal; +namespace BaGetter.Protocol.ServiceIndex; /// /// The NuGet Service Index client, used to discover other resources. diff --git a/src/BaGetter.Protocol/ServiceIndex/ServiceIndexClient.cs b/src/BaGetter.Protocol/ServiceIndex/ServiceIndexClient.cs index 91e6f6167..a734efe3b 100644 --- a/src/BaGetter.Protocol/ServiceIndex/ServiceIndexClient.cs +++ b/src/BaGetter.Protocol/ServiceIndex/ServiceIndexClient.cs @@ -2,7 +2,9 @@ using System.Threading; using System.Threading.Tasks; using BaGetter.Protocol.Models; +using BaGetter.Protocol.ServiceIndex; +// ReSharper disable once CheckNamespace namespace BaGetter.Protocol; public partial class NuGetClientFactory diff --git a/src/BaGetter.Tencent/BaGetter.Tencent.csproj b/src/BaGetter.Tencent/BaGetter.Tencent.csproj index 434765158..777902cb5 100644 --- a/src/BaGetter.Tencent/BaGetter.Tencent.csproj +++ b/src/BaGetter.Tencent/BaGetter.Tencent.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 enable The libraries to host BaGetter on Tencent Cloud. enable diff --git a/src/BaGetter.Tencent/TencentApplicationExtensions.cs b/src/BaGetter.Tencent/TencentApplicationExtensions.cs index 96fe60ea9..4652a9af4 100644 --- a/src/BaGetter.Tencent/TencentApplicationExtensions.cs +++ b/src/BaGetter.Tencent/TencentApplicationExtensions.cs @@ -1,4 +1,7 @@ using BaGetter.Core; +using BaGetter.Core.Configuration; +using BaGetter.Core.Extensions; +using BaGetter.Core.Storage; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection.Extensions; using Microsoft.Extensions.Options; diff --git a/src/BaGetter.Tencent/TencentStorageService.cs b/src/BaGetter.Tencent/TencentStorageService.cs index aa6a2994f..698fd7759 100644 --- a/src/BaGetter.Tencent/TencentStorageService.cs +++ b/src/BaGetter.Tencent/TencentStorageService.cs @@ -1,4 +1,4 @@ -using BaGetter.Core; +using BaGetter.Core.Storage; using Microsoft.Extensions.Options; namespace BaGetter.Tencent; diff --git a/src/BaGetter.Web/Authentication/NugetBasicAuthenticationHandler.cs b/src/BaGetter.Web/Authentication/NugetBasicAuthenticationHandler.cs index ef5031e79..53a7d9915 100644 --- a/src/BaGetter.Web/Authentication/NugetBasicAuthenticationHandler.cs +++ b/src/BaGetter.Web/Authentication/NugetBasicAuthenticationHandler.cs @@ -7,8 +7,8 @@ using System.Text; using System.Threading.Tasks; using System; -using BaGetter.Core; using System.Linq; +using BaGetter.Core.Configuration; namespace BaGetter.Web.Authentication; diff --git a/src/BaGetter.Web/BaGetter.Web.csproj b/src/BaGetter.Web/BaGetter.Web.csproj index ff350457c..c2e02fca1 100644 --- a/src/BaGetter.Web/BaGetter.Web.csproj +++ b/src/BaGetter.Web/BaGetter.Web.csproj @@ -1,7 +1,7 @@ - net9.0 + net10.0 NuGet BaGetter's NuGet server implementation @@ -21,6 +21,6 @@ - + diff --git a/src/BaGetter.Web/BaGetterEndpointBuilder.cs b/src/BaGetter.Web/BaGetterEndpointBuilder.cs index c35fb4401..32f7e6eec 100644 --- a/src/BaGetter.Web/BaGetterEndpointBuilder.cs +++ b/src/BaGetter.Web/BaGetterEndpointBuilder.cs @@ -1,10 +1,9 @@ using System.Diagnostics.CodeAnalysis; -using BaGetter.Web; using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Routing; using Microsoft.AspNetCore.Routing.Constraints; -namespace BaGetter; +namespace BaGetter.Web; [SuppressMessage("Performance", "CA1822:Mark members as static", Justification = "Would be a breaking change since it's part of the public API")] public class BaGetterEndpointBuilder diff --git a/src/BaGetter.Web/Controllers/PackageContentController.cs b/src/BaGetter.Web/Controllers/PackageContentController.cs index 62e3bfdd1..7d34ddb74 100644 --- a/src/BaGetter.Web/Controllers/PackageContentController.cs +++ b/src/BaGetter.Web/Controllers/PackageContentController.cs @@ -1,14 +1,14 @@ using System; using System.Threading; using System.Threading.Tasks; -using BaGetter.Authentication; -using BaGetter.Core; +using BaGetter.Core.Authentication; +using BaGetter.Core.Content; using BaGetter.Protocol.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using NuGet.Versioning; -namespace BaGetter.Web; +namespace BaGetter.Web.Controllers; /// /// The Package Content resource, used to download content from packages. diff --git a/src/BaGetter.Web/Controllers/PackageMetadataController.cs b/src/BaGetter.Web/Controllers/PackageMetadataController.cs index 914068f5b..1f2cf05ad 100644 --- a/src/BaGetter.Web/Controllers/PackageMetadataController.cs +++ b/src/BaGetter.Web/Controllers/PackageMetadataController.cs @@ -1,14 +1,14 @@ using System; using System.Threading; using System.Threading.Tasks; -using BaGetter.Authentication; -using BaGetter.Core; +using BaGetter.Core.Authentication; +using BaGetter.Core.Metadata; using BaGetter.Protocol.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using NuGet.Versioning; -namespace BaGetter.Web; +namespace BaGetter.Web.Controllers; /// /// The Package Metadata resource, used to fetch packages' information. diff --git a/src/BaGetter.Web/Controllers/PackagePublishController.cs b/src/BaGetter.Web/Controllers/PackagePublishController.cs index c66b3bbe1..8bb3384a3 100644 --- a/src/BaGetter.Web/Controllers/PackagePublishController.cs +++ b/src/BaGetter.Web/Controllers/PackagePublishController.cs @@ -2,12 +2,16 @@ using System.Threading; using System.Threading.Tasks; using BaGetter.Core; +using BaGetter.Core.Authentication; +using BaGetter.Core.Configuration; +using BaGetter.Core.Indexing; +using BaGetter.Web.Extensions; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; using NuGet.Versioning; -namespace BaGetter.Web; +namespace BaGetter.Web.Controllers; public class PackagePublishController : Controller { diff --git a/src/BaGetter.Web/Controllers/SearchController.cs b/src/BaGetter.Web/Controllers/SearchController.cs index fe39d2d63..ac6545b60 100644 --- a/src/BaGetter.Web/Controllers/SearchController.cs +++ b/src/BaGetter.Web/Controllers/SearchController.cs @@ -1,13 +1,13 @@ using System; using System.Threading; using System.Threading.Tasks; -using BaGetter.Authentication; -using BaGetter.Core; +using BaGetter.Core.Authentication; +using BaGetter.Core.Search; using BaGetter.Protocol.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -namespace BaGetter.Web; +namespace BaGetter.Web.Controllers; [Authorize(AuthenticationSchemes = AuthenticationConstants.NugetBasicAuthenticationScheme, Policy = AuthenticationConstants.NugetUserPolicy)] public class SearchController : Controller diff --git a/src/BaGetter.Web/Controllers/ServiceIndexController.cs b/src/BaGetter.Web/Controllers/ServiceIndexController.cs index 2e66edff1..22bd03eda 100644 --- a/src/BaGetter.Web/Controllers/ServiceIndexController.cs +++ b/src/BaGetter.Web/Controllers/ServiceIndexController.cs @@ -1,13 +1,13 @@ using System; using System.Threading; using System.Threading.Tasks; -using BaGetter.Authentication; -using BaGetter.Core; +using BaGetter.Core.Authentication; +using BaGetter.Core.ServiceIndex; using BaGetter.Protocol.Models; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; -namespace BaGetter.Web; +namespace BaGetter.Web.Controllers; /// /// The NuGet Service Index. This aids NuGet client to discover this server's services. diff --git a/src/BaGetter.Web/Controllers/SymbolController.cs b/src/BaGetter.Web/Controllers/SymbolController.cs index 2cd99a383..800934f2e 100644 --- a/src/BaGetter.Web/Controllers/SymbolController.cs +++ b/src/BaGetter.Web/Controllers/SymbolController.cs @@ -1,14 +1,17 @@ using System; using System.Threading; using System.Threading.Tasks; -using BaGetter.Authentication; -using BaGetter.Core; +using BaGetter.Core.Authentication; +using BaGetter.Core.Configuration; +using BaGetter.Core.Indexing; +using BaGetter.Core.Storage; +using BaGetter.Web.Extensions; using Microsoft.AspNetCore.Authorization; using Microsoft.AspNetCore.Mvc; using Microsoft.Extensions.Logging; using Microsoft.Extensions.Options; -namespace BaGetter.Web; +namespace BaGetter.Web.Controllers; [Authorize(AuthenticationSchemes = AuthenticationConstants.NugetBasicAuthenticationScheme, Policy = AuthenticationConstants.NugetUserPolicy)] public class SymbolController : Controller diff --git a/src/BaGetter.Web/Extensions/HttpRequestExtensions.cs b/src/BaGetter.Web/Extensions/HttpRequestExtensions.cs index f825af1b2..39af25d83 100644 --- a/src/BaGetter.Web/Extensions/HttpRequestExtensions.cs +++ b/src/BaGetter.Web/Extensions/HttpRequestExtensions.cs @@ -1,10 +1,10 @@ using System.IO; using System.Threading; using System.Threading.Tasks; -using BaGetter.Core; +using BaGetter.Core.Extensions; using Microsoft.AspNetCore.Http; -namespace BaGetter.Web; +namespace BaGetter.Web.Extensions; public static class HttpRequestExtensions { diff --git a/src/BaGetter.Web/Extensions/IApplicationBuilderExtensions.cs b/src/BaGetter.Web/Extensions/IApplicationBuilderExtensions.cs index 259a04218..c1226dd5f 100644 --- a/src/BaGetter.Web/Extensions/IApplicationBuilderExtensions.cs +++ b/src/BaGetter.Web/Extensions/IApplicationBuilderExtensions.cs @@ -1,7 +1,7 @@ using System; using Microsoft.AspNetCore.Builder; -namespace BaGetter.Web; +namespace BaGetter.Web.Extensions; public static class IApplicationBuilderExtensions { diff --git a/src/BaGetter.Web/Extensions/IHostExtensions.cs b/src/BaGetter.Web/Extensions/IHostExtensions.cs index 794bf1018..f5940a791 100644 --- a/src/BaGetter.Web/Extensions/IHostExtensions.cs +++ b/src/BaGetter.Web/Extensions/IHostExtensions.cs @@ -2,11 +2,14 @@ using System.Threading; using System.Threading.Tasks; using BaGetter.Core; +using BaGetter.Core.Configuration; +using BaGetter.Core.Entities; +using BaGetter.Core.Validation; using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Options; -namespace BaGetter.Web; +namespace BaGetter.Web.Extensions; public static class IHostExtensions { diff --git a/src/BaGetter.Web/Extensions/IServiceCollectionExtensions.cs b/src/BaGetter.Web/Extensions/IServiceCollectionExtensions.cs index 2b08aecee..96ce538cb 100644 --- a/src/BaGetter.Web/Extensions/IServiceCollectionExtensions.cs +++ b/src/BaGetter.Web/Extensions/IServiceCollectionExtensions.cs @@ -1,14 +1,12 @@ using System; using System.Text.Json.Serialization; -using BaGetter.Authentication; using BaGetter.Core; -using BaGetter.Web; -using BaGetter.Web.Authentication; +using BaGetter.Core.Extensions; +using BaGetter.Web.Controllers; using BaGetter.Web.Helper; -using Microsoft.AspNetCore.Authorization; using Microsoft.Extensions.DependencyInjection; -namespace BaGetter; +namespace BaGetter.Web.Extensions; public static class IServiceCollectionExtensions { diff --git a/src/BaGetter.Web/Extensions/RazorExtensions.cs b/src/BaGetter.Web/Extensions/RazorExtensions.cs index b16f34780..8aa11d5b2 100644 --- a/src/BaGetter.Web/Extensions/RazorExtensions.cs +++ b/src/BaGetter.Web/Extensions/RazorExtensions.cs @@ -1,6 +1,6 @@ using Humanizer; -namespace BaGetter.Web; +namespace BaGetter.Web.Extensions; public static class RazorExtensions { diff --git a/src/BaGetter.Web/Pages/Index.cshtml b/src/BaGetter.Web/Pages/Index.cshtml index 4595be5fa..23bba0d29 100644 --- a/src/BaGetter.Web/Pages/Index.cshtml +++ b/src/BaGetter.Web/Pages/Index.cshtml @@ -1,4 +1,6 @@ @page +@using BaGetter.Protocol.Models +@using BaGetter.Web.Extensions @model IndexModel @{ @@ -37,7 +39,7 @@