diff --git a/services/Directory/FilterLists.Directory.Api/FilterLists.Directory.Api.csproj b/services/Directory/FilterLists.Directory.Api/FilterLists.Directory.Api.csproj index 37c237246..4bd34fb34 100644 --- a/services/Directory/FilterLists.Directory.Api/FilterLists.Directory.Api.csproj +++ b/services/Directory/FilterLists.Directory.Api/FilterLists.Directory.Api.csproj @@ -4,6 +4,7 @@ net8.0 enable enable + Recommended diff --git a/services/Directory/FilterLists.Directory.Api/OpenApi/OpenApiTags.cs b/services/Directory/FilterLists.Directory.Api/OpenApi/OpenApiTags.cs index d4e519cb5..e61c686f1 100644 --- a/services/Directory/FilterLists.Directory.Api/OpenApi/OpenApiTags.cs +++ b/services/Directory/FilterLists.Directory.Api/OpenApi/OpenApiTags.cs @@ -87,7 +87,7 @@ internal static class OpenApiTags }; [UsedImplicitly] - internal class TagDescriptionsDocumentFilter : IDocumentFilter + internal sealed class TagDescriptionsDocumentFilter : IDocumentFilter { public void Apply(OpenApiDocument swaggerDoc, DocumentFilterContext context) { diff --git a/services/Directory/FilterLists.Directory.Application/FilterLists.Directory.Application.csproj b/services/Directory/FilterLists.Directory.Application/FilterLists.Directory.Application.csproj index fb378cf12..7aca7aeb6 100644 --- a/services/Directory/FilterLists.Directory.Application/FilterLists.Directory.Application.csproj +++ b/services/Directory/FilterLists.Directory.Application/FilterLists.Directory.Application.csproj @@ -4,19 +4,19 @@ net8.0 enable enable + Recommended true - 1591;1701;1702 + 1591;1701;1702 - 1591;1701;1702 + 1591;1701;1702 - diff --git a/services/Directory/FilterLists.Directory.Application/Queries/GetLanguages.cs b/services/Directory/FilterLists.Directory.Application/Queries/GetLanguages.cs index 4384e9289..ea81aaf85 100644 --- a/services/Directory/FilterLists.Directory.Application/Queries/GetLanguages.cs +++ b/services/Directory/FilterLists.Directory.Application/Queries/GetLanguages.cs @@ -37,7 +37,7 @@ public async IAsyncEnumerable Handle(Request request, [EnumeratorCan } [PublicAPI] - public record LanguageVm + public sealed record LanguageVm { /// /// The identifier. diff --git a/services/Directory/FilterLists.Directory.Application/Queries/GetLicenses.cs b/services/Directory/FilterLists.Directory.Application/Queries/GetLicenses.cs index 9ca96698a..8be9e6cf5 100644 --- a/services/Directory/FilterLists.Directory.Application/Queries/GetLicenses.cs +++ b/services/Directory/FilterLists.Directory.Application/Queries/GetLicenses.cs @@ -40,7 +40,7 @@ public async IAsyncEnumerable Handle(Request request, [EnumeratorCanc } [PublicAPI] - public record LicenseVm + public sealed record LicenseVm { /// /// The identifier. diff --git a/services/Directory/FilterLists.Directory.Application/Queries/GetListDetails.cs b/services/Directory/FilterLists.Directory.Application/Queries/GetListDetails.cs index 7d4df4cd6..6d6d9012c 100644 --- a/services/Directory/FilterLists.Directory.Application/Queries/GetListDetails.cs +++ b/services/Directory/FilterLists.Directory.Application/Queries/GetListDetails.cs @@ -81,7 +81,7 @@ private sealed class Handler(QueryDbContext ctx) : IRequestHandler /// The identifier. @@ -231,7 +231,7 @@ public record ListDetailsVm public IEnumerable DependentFilterListIds { get; init; } = []; [PublicAPI] - public record ViewUrlVm + public sealed record ViewUrlVm { /// /// The segment number of the URL for the FilterList (for multi-part lists). diff --git a/services/Directory/FilterLists.Directory.Application/Queries/GetLists.cs b/services/Directory/FilterLists.Directory.Application/Queries/GetLists.cs index 4cb736641..e7d2117e3 100644 --- a/services/Directory/FilterLists.Directory.Application/Queries/GetLists.cs +++ b/services/Directory/FilterLists.Directory.Application/Queries/GetLists.cs @@ -51,7 +51,7 @@ public async IAsyncEnumerable Handle(Request request, [EnumeratorCancell } [PublicAPI] - public record ListVm + public sealed record ListVm { /// /// The identifier. diff --git a/services/Directory/FilterLists.Directory.Application/Queries/GetMaintainers.cs b/services/Directory/FilterLists.Directory.Application/Queries/GetMaintainers.cs index aaa3b2db6..25aae99fc 100644 --- a/services/Directory/FilterLists.Directory.Application/Queries/GetMaintainers.cs +++ b/services/Directory/FilterLists.Directory.Application/Queries/GetMaintainers.cs @@ -40,7 +40,7 @@ public async IAsyncEnumerable Handle(Request request, } [PublicAPI] - public record MaintainerVm + public sealed record MaintainerVm { /// /// The identifier. diff --git a/services/Directory/FilterLists.Directory.Application/Queries/GetSoftware.cs b/services/Directory/FilterLists.Directory.Application/Queries/GetSoftware.cs index 7d639011e..3413f8447 100644 --- a/services/Directory/FilterLists.Directory.Application/Queries/GetSoftware.cs +++ b/services/Directory/FilterLists.Directory.Application/Queries/GetSoftware.cs @@ -42,7 +42,7 @@ public async IAsyncEnumerable Handle(Request request, } [PublicAPI] - public record SoftwareVm + public sealed record SoftwareVm { /// /// The identifier. diff --git a/services/Directory/FilterLists.Directory.Application/Queries/GetSyntaxes.cs b/services/Directory/FilterLists.Directory.Application/Queries/GetSyntaxes.cs index 4da46d23d..e4c66310d 100644 --- a/services/Directory/FilterLists.Directory.Application/Queries/GetSyntaxes.cs +++ b/services/Directory/FilterLists.Directory.Application/Queries/GetSyntaxes.cs @@ -42,7 +42,7 @@ public async IAsyncEnumerable Handle(Request request, } [PublicAPI] - public record SyntaxVm + public sealed record SyntaxVm { /// /// The identifier. diff --git a/services/Directory/FilterLists.Directory.Application/Queries/GetTags.cs b/services/Directory/FilterLists.Directory.Application/Queries/GetTags.cs index 14f64a0d3..151b9cd01 100644 --- a/services/Directory/FilterLists.Directory.Application/Queries/GetTags.cs +++ b/services/Directory/FilterLists.Directory.Application/Queries/GetTags.cs @@ -38,7 +38,7 @@ public async IAsyncEnumerable Handle(Request request, } [PublicAPI] - public record TagVm + public sealed record TagVm { /// /// The identifier. diff --git a/services/Directory/FilterLists.Directory.Infrastructure.MigrationService/FilterLists.Directory.Infrastructure.MigrationService.csproj b/services/Directory/FilterLists.Directory.Infrastructure.MigrationService/FilterLists.Directory.Infrastructure.MigrationService.csproj index ae1ecde73..d1ff2f478 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure.MigrationService/FilterLists.Directory.Infrastructure.MigrationService.csproj +++ b/services/Directory/FilterLists.Directory.Infrastructure.MigrationService/FilterLists.Directory.Infrastructure.MigrationService.csproj @@ -4,6 +4,7 @@ net8.0 enable enable + Recommended diff --git a/services/Directory/FilterLists.Directory.Infrastructure.MigrationService/Worker.cs b/services/Directory/FilterLists.Directory.Infrastructure.MigrationService/Worker.cs index 36fcecfc2..426e04dd4 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure.MigrationService/Worker.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure.MigrationService/Worker.cs @@ -8,7 +8,7 @@ namespace FilterLists.Directory.Infrastructure.MigrationService; /// https://learn.microsoft.com/en-us/dotnet/aspire/database/ef-core-migrations#create-the-migration-service -public class Worker( +public sealed class Worker( IServiceProvider serviceProvider, IHostApplicationLifetime hostApplicationLifetime, IHostEnvironment hostEnvironment) : BackgroundService @@ -16,10 +16,10 @@ public class Worker( private const string ActivitySourceName = "Migrations"; private static readonly ActivitySource ActivitySource = new(ActivitySourceName); - protected override async Task ExecuteAsync(CancellationToken cancellationToken) + protected override async Task ExecuteAsync(CancellationToken stoppingToken) { // allow SQL Server container time to start - await Task.Delay(3000, cancellationToken); + await Task.Delay(3000, stoppingToken); // ReSharper disable once ExplicitCallerInfoArgument using var activity = ActivitySource.StartActivity("Migrating database", ActivityKind.Client); @@ -29,8 +29,8 @@ protected override async Task ExecuteAsync(CancellationToken cancellationToken) using var scope = serviceProvider.CreateScope(); var dbContext = scope.ServiceProvider.GetRequiredService(); - if (hostEnvironment.IsDevelopment()) await EnsureDatabaseAsync(dbContext, cancellationToken); - await RunMigrationAsync(dbContext, cancellationToken); + if (hostEnvironment.IsDevelopment()) await EnsureDatabaseAsync(dbContext, stoppingToken); + await RunMigrationAsync(dbContext, stoppingToken); } catch (Exception ex) { diff --git a/services/Directory/FilterLists.Directory.Infrastructure/FilterLists.Directory.Infrastructure.csproj b/services/Directory/FilterLists.Directory.Infrastructure/FilterLists.Directory.Infrastructure.csproj index bc05edd78..42fb79400 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/FilterLists.Directory.Infrastructure.csproj +++ b/services/Directory/FilterLists.Directory.Infrastructure/FilterLists.Directory.Infrastructure.csproj @@ -4,10 +4,12 @@ net8.0 enable enable + Recommended + diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Context/QueryDbContext.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Context/QueryDbContext.cs index bffc5b84a..283f3ad0a 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Context/QueryDbContext.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Context/QueryDbContext.cs @@ -4,7 +4,7 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Context; // TODO: explicitly make more readonly-ish -public class QueryDbContext(DbContextOptions options) : DbContext(options) +public sealed class QueryDbContext(DbContextOptions options) : DbContext(options) { public DbSet FilterLists => Set(); public DbSet Languages => Set(); diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Dependent.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Dependent.cs index 4d3d266ed..d7af307fa 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Dependent.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Dependent.cs @@ -3,7 +3,7 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; -public record Dependent +public sealed record Dependent { public int DependencyFilterListId { get; init; } public FilterList DependencyFilterList { get; init; } = null!; @@ -11,9 +11,9 @@ public record Dependent public FilterList DependentFilterList { get; init; } = null!; } -internal class DependentTypeConfiguration : IEntityTypeConfiguration +internal sealed class DependentTypeConfiguration : IEntityTypeConfiguration { - public virtual void Configure(EntityTypeBuilder builder) + public void Configure(EntityTypeBuilder builder) { builder.HasKey(d => new { d.DependencyFilterListId, d.DependentFilterListId }); builder.HasOne(d => d.DependencyFilterList) diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterList.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterList.cs index 98f0bcd36..cceb3c844 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterList.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterList.cs @@ -3,7 +3,7 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; -public record FilterList +public sealed record FilterList { public int Id { get; init; } public string Name { get; init; } = null!; @@ -32,9 +32,9 @@ public record FilterList public IEnumerable DependentFilterLists { get; init; } = new List(); } -internal class FilterListTypeConfiguration : IEntityTypeConfiguration +internal sealed class FilterListTypeConfiguration : IEntityTypeConfiguration { - public virtual void Configure(EntityTypeBuilder builder) + public void Configure(EntityTypeBuilder builder) { builder.Property(f => f.Name) .HasMaxLength(256); diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListLanguage.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListLanguage.cs index 1d2f3d932..85522e4cc 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListLanguage.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListLanguage.cs @@ -3,7 +3,7 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; -public record FilterListLanguage +public sealed record FilterListLanguage { public int FilterListId { get; init; } public FilterList FilterList { get; init; } = null!; @@ -11,9 +11,9 @@ public record FilterListLanguage public Language Language { get; init; } = null!; } -internal class FilterListLanguageTypeConfiguration : IEntityTypeConfiguration +internal sealed class FilterListLanguageTypeConfiguration : IEntityTypeConfiguration { - public virtual void Configure(EntityTypeBuilder builder) + public void Configure(EntityTypeBuilder builder) { builder.HasKey(fll => new { fll.FilterListId, fll.LanguageId }); builder.HasDataJsonFile(); diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListMaintainer.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListMaintainer.cs index fee8e2634..f6dd0cc0a 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListMaintainer.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListMaintainer.cs @@ -3,7 +3,7 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; -public record FilterListMaintainer +public sealed record FilterListMaintainer { public int FilterListId { get; init; } public FilterList FilterList { get; init; } = null!; @@ -11,9 +11,9 @@ public record FilterListMaintainer public Maintainer Maintainer { get; init; } = null!; } -internal class FilterListMaintainerTypeConfiguration : IEntityTypeConfiguration +internal sealed class FilterListMaintainerTypeConfiguration : IEntityTypeConfiguration { - public virtual void Configure(EntityTypeBuilder builder) + public void Configure(EntityTypeBuilder builder) { builder.HasKey(flm => new { flm.FilterListId, flm.MaintainerId }); builder.HasDataJsonFile(); diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListSyntax.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListSyntax.cs index 75552655e..9b8bcc7e9 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListSyntax.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListSyntax.cs @@ -3,7 +3,7 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; -public record FilterListSyntax +public sealed record FilterListSyntax { public int FilterListId { get; init; } public FilterList FilterList { get; init; } = null!; @@ -11,9 +11,9 @@ public record FilterListSyntax public Syntax Syntax { get; init; } = null!; } -internal class FilterListSyntaxTypeConfiguration : IEntityTypeConfiguration +internal sealed class FilterListSyntaxTypeConfiguration : IEntityTypeConfiguration { - public virtual void Configure(EntityTypeBuilder builder) + public void Configure(EntityTypeBuilder builder) { builder.HasKey(fls => new { fls.FilterListId, fls.SyntaxId }); builder.HasDataJsonFile(); diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListTag.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListTag.cs index 7771ae31a..d76c96220 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListTag.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListTag.cs @@ -3,7 +3,7 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; -public record FilterListTag +public sealed record FilterListTag { public int FilterListId { get; init; } public FilterList FilterList { get; init; } = null!; @@ -11,9 +11,9 @@ public record FilterListTag public Tag Tag { get; init; } = null!; } -internal class FilterListTagTypeConfiguration : IEntityTypeConfiguration +internal sealed class FilterListTagTypeConfiguration : IEntityTypeConfiguration { - public virtual void Configure(EntityTypeBuilder builder) + public void Configure(EntityTypeBuilder builder) { builder.HasKey(flt => new { flt.FilterListId, flt.TagId }); builder.HasDataJsonFile(); diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListViewUrl.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListViewUrl.cs index 49d918f3f..dcaec5427 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListViewUrl.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/FilterListViewUrl.cs @@ -1,6 +1,9 @@ -namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; +using JetBrains.Annotations; -public record FilterListViewUrl +namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; + +[PublicAPI] +public sealed record FilterListViewUrl { public int Id { get; init; } public int FilterListId { get; init; } diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Fork.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Fork.cs index 55de65e39..58bc9dccf 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Fork.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Fork.cs @@ -3,7 +3,7 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; -public record Fork +public sealed record Fork { public int UpstreamFilterListId { get; init; } public FilterList UpstreamFilterList { get; init; } = null!; @@ -11,9 +11,9 @@ public record Fork public FilterList ForkFilterList { get; init; } = null!; } -internal class ForkTypeConfiguration : IEntityTypeConfiguration +internal sealed class ForkTypeConfiguration : IEntityTypeConfiguration { - public virtual void Configure(EntityTypeBuilder builder) + public void Configure(EntityTypeBuilder builder) { builder.HasKey(f => new { f.UpstreamFilterListId, f.ForkFilterListId }); builder.HasOne(f => f.UpstreamFilterList) diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Language.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Language.cs index 2674f6ac5..35e362d5a 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Language.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Language.cs @@ -3,7 +3,7 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; -public record Language +public sealed record Language { public short Id { get; init; } public string Iso6391 { get; init; } = null!; @@ -11,9 +11,9 @@ public record Language public IEnumerable FilterListLanguages { get; init; } = new List(); } -internal class LanguageTypeConfiguration : IEntityTypeConfiguration +internal sealed class LanguageTypeConfiguration : IEntityTypeConfiguration { - public virtual void Configure(EntityTypeBuilder builder) + public void Configure(EntityTypeBuilder builder) { builder.Property(l => l.Iso6391) .IsFixedLength() diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/License.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/License.cs index 36f50d2bc..26f3f6402 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/License.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/License.cs @@ -3,7 +3,7 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; -public record License +public sealed record License { public int Id { get; init; } public string Name { get; init; } = null!; @@ -14,9 +14,9 @@ public record License public IEnumerable FilterLists { get; init; } = new List(); } -internal class LicenseTypeConfiguration : IEntityTypeConfiguration +internal sealed class LicenseTypeConfiguration : IEntityTypeConfiguration { - public virtual void Configure(EntityTypeBuilder builder) + public void Configure(EntityTypeBuilder builder) { builder.Property(l => l.Name) .HasMaxLength(64); diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Maintainer.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Maintainer.cs index 451441e2e..9a101e6b4 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Maintainer.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Maintainer.cs @@ -3,7 +3,7 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; -public record Maintainer +public sealed record Maintainer { public int Id { get; init; } public string Name { get; init; } = null!; @@ -13,9 +13,9 @@ public record Maintainer public IEnumerable FilterListMaintainers { get; init; } = new List(); } -internal class MaintainerTypeConfiguration : IEntityTypeConfiguration +internal sealed class MaintainerTypeConfiguration : IEntityTypeConfiguration { - public virtual void Configure(EntityTypeBuilder builder) + public void Configure(EntityTypeBuilder builder) { builder.Property(m => m.Name) .HasMaxLength(64); diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Merge.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Merge.cs index 9ab2510cf..bdcae439a 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Merge.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Merge.cs @@ -3,7 +3,7 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; -public record Merge +public sealed record Merge { public int IncludedInFilterListId { get; init; } public FilterList IncludedInFilterList { get; init; } = null!; @@ -11,9 +11,9 @@ public record Merge public FilterList IncludesFilterList { get; init; } = null!; } -internal class MergeTypeConfiguration : IEntityTypeConfiguration +internal sealed class MergeTypeConfiguration : IEntityTypeConfiguration { - public virtual void Configure(EntityTypeBuilder builder) + public void Configure(EntityTypeBuilder builder) { builder.HasKey(m => new { m.IncludedInFilterListId, m.IncludesFilterListId }); builder.HasOne(m => m.IncludedInFilterList) diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Software.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Software.cs index d3a8a7714..fed29b30f 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Software.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Software.cs @@ -3,7 +3,7 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; -public record Software +public sealed record Software { public short Id { get; init; } public string Name { get; init; } = null!; @@ -14,9 +14,9 @@ public record Software public IEnumerable SoftwareSyntaxes { get; init; } = new List(); } -internal class SoftwareTypeConfiguration : IEntityTypeConfiguration +internal sealed class SoftwareTypeConfiguration : IEntityTypeConfiguration { - public virtual void Configure(EntityTypeBuilder builder) + public void Configure(EntityTypeBuilder builder) { builder.Property(s => s.Name) .HasMaxLength(64); diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/SoftwareSyntax.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/SoftwareSyntax.cs index b3326153e..2c8003b83 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/SoftwareSyntax.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/SoftwareSyntax.cs @@ -3,7 +3,7 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; -public record SoftwareSyntax +public sealed record SoftwareSyntax { public short SoftwareId { get; init; } public Software Software { get; init; } = null!; @@ -11,9 +11,9 @@ public record SoftwareSyntax public Syntax Syntax { get; init; } = null!; } -internal class SoftwareSyntaxTypeConfiguration : IEntityTypeConfiguration +internal sealed class SoftwareSyntaxTypeConfiguration : IEntityTypeConfiguration { - public virtual void Configure(EntityTypeBuilder builder) + public void Configure(EntityTypeBuilder builder) { builder.HasKey(ss => new { ss.SoftwareId, ss.SyntaxId }); builder.HasDataJsonFile(); diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Syntax.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Syntax.cs index f32ecc035..a529a4a23 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Syntax.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Syntax.cs @@ -3,7 +3,7 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; -public record Syntax +public sealed record Syntax { public short Id { get; init; } public string Name { get; init; } = null!; @@ -13,9 +13,9 @@ public record Syntax public IEnumerable SoftwareSyntaxes { get; init; } = new List(); } -internal class SyntaxTypeConfiguration : IEntityTypeConfiguration +internal sealed class SyntaxTypeConfiguration : IEntityTypeConfiguration { - public virtual void Configure(EntityTypeBuilder builder) + public void Configure(EntityTypeBuilder builder) { builder.Property(s => s.Name) .HasMaxLength(64); diff --git a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Tag.cs b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Tag.cs index 25ea916bb..67caa78e2 100644 --- a/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Tag.cs +++ b/services/Directory/FilterLists.Directory.Infrastructure/Persistence/Queries/Entities/Tag.cs @@ -3,7 +3,7 @@ namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Entities; -public record Tag +public sealed record Tag { public int Id { get; init; } public string Name { get; init; } = null!; @@ -11,9 +11,9 @@ public record Tag public IEnumerable FilterListTags { get; init; } = new List(); } -internal class TagTypeConfiguration : IEntityTypeConfiguration +internal sealed class TagTypeConfiguration : IEntityTypeConfiguration { - public virtual void Configure(EntityTypeBuilder builder) + public void Configure(EntityTypeBuilder builder) { builder.Property(t => t.Name) .HasMaxLength(32); diff --git a/services/FilterLists.AppHost/FilterLists.AppHost.csproj b/services/FilterLists.AppHost/FilterLists.AppHost.csproj index 349aae467..df3ab2785 100644 --- a/services/FilterLists.AppHost/FilterLists.AppHost.csproj +++ b/services/FilterLists.AppHost/FilterLists.AppHost.csproj @@ -7,6 +7,7 @@ enable true c7967ef0-ced7-4e18-8282-7302b3c0002b + Recommended diff --git a/services/FilterLists.ServiceDefaults/FilterLists.ServiceDefaults.csproj b/services/FilterLists.ServiceDefaults/FilterLists.ServiceDefaults.csproj index 56cc62c0d..dac574ede 100644 --- a/services/FilterLists.ServiceDefaults/FilterLists.ServiceDefaults.csproj +++ b/services/FilterLists.ServiceDefaults/FilterLists.ServiceDefaults.csproj @@ -5,6 +5,7 @@ enable enable true + Recommended diff --git a/services/FilterLists.Tests/FilterLists.Tests.csproj b/services/FilterLists.Tests/FilterLists.Tests.csproj index 16452f28a..0c680a658 100644 --- a/services/FilterLists.Tests/FilterLists.Tests.csproj +++ b/services/FilterLists.Tests/FilterLists.Tests.csproj @@ -6,6 +6,7 @@ enable false true + Recommended diff --git a/services/FilterLists.Tests/WebTests.cs b/services/FilterLists.Tests/WebTests.cs index 5df6990e5..aa0e404e7 100644 --- a/services/FilterLists.Tests/WebTests.cs +++ b/services/FilterLists.Tests/WebTests.cs @@ -3,7 +3,7 @@ namespace FilterLists.Tests; -public class WebTests +public sealed class WebTests { [Fact] public async Task GetWebResourceRootReturnsOkStatusCode()