mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
refactor(svcs): 🔧♻️ configure & apply AnalysisMode Recommended
This commit is contained in:
parent
a0c337e0ab
commit
1c1fb09e20
35 changed files with 77 additions and 67 deletions
|
|
@ -4,6 +4,7 @@
|
|||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AnalysisMode>Recommended</AnalysisMode>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,19 +4,19 @@
|
|||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AnalysisMode>Recommended</AnalysisMode>
|
||||
<GenerateDocumentationFile>true</GenerateDocumentationFile>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
|
||||
<NoWarn>1591;1701;1702</NoWarn>
|
||||
<NoWarn>1591;1701;1702</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
|
||||
<NoWarn>1591;1701;1702</NoWarn>
|
||||
<NoWarn>1591;1701;1702</NoWarn>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0"/>
|
||||
<PackageReference Include="MediatR" Version="12.2.0"/>
|
||||
</ItemGroup>
|
||||
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@ public async IAsyncEnumerable<LanguageVm> Handle(Request request, [EnumeratorCan
|
|||
}
|
||||
|
||||
[PublicAPI]
|
||||
public record LanguageVm
|
||||
public sealed record LanguageVm
|
||||
{
|
||||
/// <summary>
|
||||
/// The identifier.
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public async IAsyncEnumerable<LicenseVm> Handle(Request request, [EnumeratorCanc
|
|||
}
|
||||
|
||||
[PublicAPI]
|
||||
public record LicenseVm
|
||||
public sealed record LicenseVm
|
||||
{
|
||||
/// <summary>
|
||||
/// The identifier.
|
||||
|
|
|
|||
|
|
@ -81,7 +81,7 @@ private sealed class Handler(QueryDbContext ctx) : IRequestHandler<Request, List
|
|||
}
|
||||
|
||||
[PublicAPI]
|
||||
public record ListDetailsVm
|
||||
public sealed record ListDetailsVm
|
||||
{
|
||||
/// <summary>
|
||||
/// The identifier.
|
||||
|
|
@ -231,7 +231,7 @@ public record ListDetailsVm
|
|||
public IEnumerable<int> DependentFilterListIds { get; init; } = [];
|
||||
|
||||
[PublicAPI]
|
||||
public record ViewUrlVm
|
||||
public sealed record ViewUrlVm
|
||||
{
|
||||
/// <summary>
|
||||
/// The segment number of the URL for the FilterList (for multi-part lists).
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public async IAsyncEnumerable<ListVm> Handle(Request request, [EnumeratorCancell
|
|||
}
|
||||
|
||||
[PublicAPI]
|
||||
public record ListVm
|
||||
public sealed record ListVm
|
||||
{
|
||||
/// <summary>
|
||||
/// The identifier.
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ public async IAsyncEnumerable<MaintainerVm> Handle(Request request,
|
|||
}
|
||||
|
||||
[PublicAPI]
|
||||
public record MaintainerVm
|
||||
public sealed record MaintainerVm
|
||||
{
|
||||
/// <summary>
|
||||
/// The identifier.
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public async IAsyncEnumerable<SoftwareVm> Handle(Request request,
|
|||
}
|
||||
|
||||
[PublicAPI]
|
||||
public record SoftwareVm
|
||||
public sealed record SoftwareVm
|
||||
{
|
||||
/// <summary>
|
||||
/// The identifier.
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ public async IAsyncEnumerable<SyntaxVm> Handle(Request request,
|
|||
}
|
||||
|
||||
[PublicAPI]
|
||||
public record SyntaxVm
|
||||
public sealed record SyntaxVm
|
||||
{
|
||||
/// <summary>
|
||||
/// The identifier.
|
||||
|
|
|
|||
|
|
@ -38,7 +38,7 @@ public async IAsyncEnumerable<TagVm> Handle(Request request,
|
|||
}
|
||||
|
||||
[PublicAPI]
|
||||
public record TagVm
|
||||
public sealed record TagVm
|
||||
{
|
||||
/// <summary>
|
||||
/// The identifier.
|
||||
|
|
|
|||
|
|
@ -4,6 +4,7 @@
|
|||
<TargetFramework>net8.0</TargetFramework>
|
||||
<Nullable>enable</Nullable>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<AnalysisMode>Recommended</AnalysisMode>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
namespace FilterLists.Directory.Infrastructure.MigrationService;
|
||||
|
||||
/// <remarks>https://learn.microsoft.com/en-us/dotnet/aspire/database/ef-core-migrations#create-the-migration-service</remarks>
|
||||
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<QueryDbContext>();
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -4,10 +4,12 @@
|
|||
<TargetFramework>net8.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AnalysisMode>Recommended</AnalysisMode>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Aspire.Microsoft.EntityFrameworkCore.SqlServer" Version="8.0.1"/>
|
||||
<PackageReference Include="JetBrains.Annotations" Version="2023.3.0"/>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
namespace FilterLists.Directory.Infrastructure.Persistence.Queries.Context;
|
||||
|
||||
// TODO: explicitly make more readonly-ish
|
||||
public class QueryDbContext(DbContextOptions<QueryDbContext> options) : DbContext(options)
|
||||
public sealed class QueryDbContext(DbContextOptions<QueryDbContext> options) : DbContext(options)
|
||||
{
|
||||
public DbSet<FilterList> FilterLists => Set<FilterList>();
|
||||
public DbSet<Language> Languages => Set<Language>();
|
||||
|
|
|
|||
|
|
@ -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<Dependent>
|
||||
internal sealed class DependentTypeConfiguration : IEntityTypeConfiguration<Dependent>
|
||||
{
|
||||
public virtual void Configure(EntityTypeBuilder<Dependent> builder)
|
||||
public void Configure(EntityTypeBuilder<Dependent> builder)
|
||||
{
|
||||
builder.HasKey(d => new { d.DependencyFilterListId, d.DependentFilterListId });
|
||||
builder.HasOne(d => d.DependencyFilterList)
|
||||
|
|
|
|||
|
|
@ -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<Dependent> DependentFilterLists { get; init; } = new List<Dependent>();
|
||||
}
|
||||
|
||||
internal class FilterListTypeConfiguration : IEntityTypeConfiguration<FilterList>
|
||||
internal sealed class FilterListTypeConfiguration : IEntityTypeConfiguration<FilterList>
|
||||
{
|
||||
public virtual void Configure(EntityTypeBuilder<FilterList> builder)
|
||||
public void Configure(EntityTypeBuilder<FilterList> builder)
|
||||
{
|
||||
builder.Property(f => f.Name)
|
||||
.HasMaxLength(256);
|
||||
|
|
|
|||
|
|
@ -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<FilterListLanguage>
|
||||
internal sealed class FilterListLanguageTypeConfiguration : IEntityTypeConfiguration<FilterListLanguage>
|
||||
{
|
||||
public virtual void Configure(EntityTypeBuilder<FilterListLanguage> builder)
|
||||
public void Configure(EntityTypeBuilder<FilterListLanguage> builder)
|
||||
{
|
||||
builder.HasKey(fll => new { fll.FilterListId, fll.LanguageId });
|
||||
builder.HasDataJsonFile<FilterListLanguage>();
|
||||
|
|
|
|||
|
|
@ -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<FilterListMaintainer>
|
||||
internal sealed class FilterListMaintainerTypeConfiguration : IEntityTypeConfiguration<FilterListMaintainer>
|
||||
{
|
||||
public virtual void Configure(EntityTypeBuilder<FilterListMaintainer> builder)
|
||||
public void Configure(EntityTypeBuilder<FilterListMaintainer> builder)
|
||||
{
|
||||
builder.HasKey(flm => new { flm.FilterListId, flm.MaintainerId });
|
||||
builder.HasDataJsonFile<FilterListMaintainer>();
|
||||
|
|
|
|||
|
|
@ -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<FilterListSyntax>
|
||||
internal sealed class FilterListSyntaxTypeConfiguration : IEntityTypeConfiguration<FilterListSyntax>
|
||||
{
|
||||
public virtual void Configure(EntityTypeBuilder<FilterListSyntax> builder)
|
||||
public void Configure(EntityTypeBuilder<FilterListSyntax> builder)
|
||||
{
|
||||
builder.HasKey(fls => new { fls.FilterListId, fls.SyntaxId });
|
||||
builder.HasDataJsonFile<FilterListSyntax>();
|
||||
|
|
|
|||
|
|
@ -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<FilterListTag>
|
||||
internal sealed class FilterListTagTypeConfiguration : IEntityTypeConfiguration<FilterListTag>
|
||||
{
|
||||
public virtual void Configure(EntityTypeBuilder<FilterListTag> builder)
|
||||
public void Configure(EntityTypeBuilder<FilterListTag> builder)
|
||||
{
|
||||
builder.HasKey(flt => new { flt.FilterListId, flt.TagId });
|
||||
builder.HasDataJsonFile<FilterListTag>();
|
||||
|
|
|
|||
|
|
@ -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; }
|
||||
|
|
|
|||
|
|
@ -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<Fork>
|
||||
internal sealed class ForkTypeConfiguration : IEntityTypeConfiguration<Fork>
|
||||
{
|
||||
public virtual void Configure(EntityTypeBuilder<Fork> builder)
|
||||
public void Configure(EntityTypeBuilder<Fork> builder)
|
||||
{
|
||||
builder.HasKey(f => new { f.UpstreamFilterListId, f.ForkFilterListId });
|
||||
builder.HasOne(f => f.UpstreamFilterList)
|
||||
|
|
|
|||
|
|
@ -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<FilterListLanguage> FilterListLanguages { get; init; } = new List<FilterListLanguage>();
|
||||
}
|
||||
|
||||
internal class LanguageTypeConfiguration : IEntityTypeConfiguration<Language>
|
||||
internal sealed class LanguageTypeConfiguration : IEntityTypeConfiguration<Language>
|
||||
{
|
||||
public virtual void Configure(EntityTypeBuilder<Language> builder)
|
||||
public void Configure(EntityTypeBuilder<Language> builder)
|
||||
{
|
||||
builder.Property(l => l.Iso6391)
|
||||
.IsFixedLength()
|
||||
|
|
|
|||
|
|
@ -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<FilterList> FilterLists { get; init; } = new List<FilterList>();
|
||||
}
|
||||
|
||||
internal class LicenseTypeConfiguration : IEntityTypeConfiguration<License>
|
||||
internal sealed class LicenseTypeConfiguration : IEntityTypeConfiguration<License>
|
||||
{
|
||||
public virtual void Configure(EntityTypeBuilder<License> builder)
|
||||
public void Configure(EntityTypeBuilder<License> builder)
|
||||
{
|
||||
builder.Property(l => l.Name)
|
||||
.HasMaxLength(64);
|
||||
|
|
|
|||
|
|
@ -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<FilterListMaintainer> FilterListMaintainers { get; init; } = new List<FilterListMaintainer>();
|
||||
}
|
||||
|
||||
internal class MaintainerTypeConfiguration : IEntityTypeConfiguration<Maintainer>
|
||||
internal sealed class MaintainerTypeConfiguration : IEntityTypeConfiguration<Maintainer>
|
||||
{
|
||||
public virtual void Configure(EntityTypeBuilder<Maintainer> builder)
|
||||
public void Configure(EntityTypeBuilder<Maintainer> builder)
|
||||
{
|
||||
builder.Property(m => m.Name)
|
||||
.HasMaxLength(64);
|
||||
|
|
|
|||
|
|
@ -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<Merge>
|
||||
internal sealed class MergeTypeConfiguration : IEntityTypeConfiguration<Merge>
|
||||
{
|
||||
public virtual void Configure(EntityTypeBuilder<Merge> builder)
|
||||
public void Configure(EntityTypeBuilder<Merge> builder)
|
||||
{
|
||||
builder.HasKey(m => new { m.IncludedInFilterListId, m.IncludesFilterListId });
|
||||
builder.HasOne(m => m.IncludedInFilterList)
|
||||
|
|
|
|||
|
|
@ -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<SoftwareSyntax> SoftwareSyntaxes { get; init; } = new List<SoftwareSyntax>();
|
||||
}
|
||||
|
||||
internal class SoftwareTypeConfiguration : IEntityTypeConfiguration<Software>
|
||||
internal sealed class SoftwareTypeConfiguration : IEntityTypeConfiguration<Software>
|
||||
{
|
||||
public virtual void Configure(EntityTypeBuilder<Software> builder)
|
||||
public void Configure(EntityTypeBuilder<Software> builder)
|
||||
{
|
||||
builder.Property(s => s.Name)
|
||||
.HasMaxLength(64);
|
||||
|
|
|
|||
|
|
@ -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<SoftwareSyntax>
|
||||
internal sealed class SoftwareSyntaxTypeConfiguration : IEntityTypeConfiguration<SoftwareSyntax>
|
||||
{
|
||||
public virtual void Configure(EntityTypeBuilder<SoftwareSyntax> builder)
|
||||
public void Configure(EntityTypeBuilder<SoftwareSyntax> builder)
|
||||
{
|
||||
builder.HasKey(ss => new { ss.SoftwareId, ss.SyntaxId });
|
||||
builder.HasDataJsonFile<SoftwareSyntax>();
|
||||
|
|
|
|||
|
|
@ -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<SoftwareSyntax> SoftwareSyntaxes { get; init; } = new List<SoftwareSyntax>();
|
||||
}
|
||||
|
||||
internal class SyntaxTypeConfiguration : IEntityTypeConfiguration<Syntax>
|
||||
internal sealed class SyntaxTypeConfiguration : IEntityTypeConfiguration<Syntax>
|
||||
{
|
||||
public virtual void Configure(EntityTypeBuilder<Syntax> builder)
|
||||
public void Configure(EntityTypeBuilder<Syntax> builder)
|
||||
{
|
||||
builder.Property(s => s.Name)
|
||||
.HasMaxLength(64);
|
||||
|
|
|
|||
|
|
@ -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<FilterListTag> FilterListTags { get; init; } = new List<FilterListTag>();
|
||||
}
|
||||
|
||||
internal class TagTypeConfiguration : IEntityTypeConfiguration<Tag>
|
||||
internal sealed class TagTypeConfiguration : IEntityTypeConfiguration<Tag>
|
||||
{
|
||||
public virtual void Configure(EntityTypeBuilder<Tag> builder)
|
||||
public void Configure(EntityTypeBuilder<Tag> builder)
|
||||
{
|
||||
builder.Property(t => t.Name)
|
||||
.HasMaxLength(32);
|
||||
|
|
|
|||
|
|
@ -7,6 +7,7 @@
|
|||
<Nullable>enable</Nullable>
|
||||
<IsAspireHost>true</IsAspireHost>
|
||||
<UserSecretsId>c7967ef0-ced7-4e18-8282-7302b3c0002b</UserSecretsId>
|
||||
<AnalysisMode>Recommended</AnalysisMode>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<IsAspireSharedProject>true</IsAspireSharedProject>
|
||||
<AnalysisMode>Recommended</AnalysisMode>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
<Nullable>enable</Nullable>
|
||||
<IsPackable>false</IsPackable>
|
||||
<IsTestProject>true</IsTestProject>
|
||||
<AnalysisMode>Recommended</AnalysisMode>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@
|
|||
|
||||
namespace FilterLists.Tests;
|
||||
|
||||
public class WebTests
|
||||
public sealed class WebTests
|
||||
{
|
||||
[Fact]
|
||||
public async Task GetWebResourceRootReturnsOkStatusCode()
|
||||
|
|
|
|||
Loading…
Reference in a new issue