mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
refactor(dir): ♻ prefer IEnumerable over IReadOnlyCollection for immutability (force copy-by-value to mutate element's props)
This commit is contained in:
parent
4f51592765
commit
179ede662b
15 changed files with 40 additions and 40 deletions
|
|
@ -6,10 +6,10 @@ public record ListDetailsVm
|
|||
public string Name { get; init; } = null!;
|
||||
public string? Description { get; init; }
|
||||
public int? LicenseId { get; init; }
|
||||
public IReadOnlyCollection<int> SyntaxIds { get; init; } = new HashSet<int>();
|
||||
public IReadOnlyCollection<string> Iso6391s { get; init; } = new HashSet<string>();
|
||||
public IReadOnlyCollection<int> TagIds { get; init; } = new HashSet<int>();
|
||||
public IReadOnlyCollection<ViewUrlVm> ViewUrls { get; init; } = new HashSet<ViewUrlVm>();
|
||||
public IEnumerable<int> SyntaxIds { get; init; } = new HashSet<int>();
|
||||
public IEnumerable<string> Iso6391s { get; init; } = new HashSet<string>();
|
||||
public IEnumerable<int> TagIds { get; init; } = new HashSet<int>();
|
||||
public IEnumerable<ViewUrlVm> ViewUrls { get; init; } = new HashSet<ViewUrlVm>();
|
||||
public Uri? HomeUrl { get; init; }
|
||||
public Uri? OnionUrl { get; init; }
|
||||
public Uri? PolicyUrl { get; init; }
|
||||
|
|
@ -19,13 +19,13 @@ public record ListDetailsVm
|
|||
public Uri? ChatUrl { get; init; }
|
||||
public string? EmailAddress { get; init; }
|
||||
public Uri? DonateUrl { get; init; }
|
||||
public IReadOnlyCollection<int> MaintainerIds { get; init; } = new HashSet<int>();
|
||||
public IReadOnlyCollection<int> UpstreamFilterListIds { get; init; } = new HashSet<int>();
|
||||
public IReadOnlyCollection<int> ForkFilterListIds { get; init; } = new HashSet<int>();
|
||||
public IReadOnlyCollection<int> IncludedInFilterListIds { get; init; } = new HashSet<int>();
|
||||
public IReadOnlyCollection<int> IncludesFilterListIds { get; init; } = new HashSet<int>();
|
||||
public IReadOnlyCollection<int> DependencyFilterListIds { get; init; } = new HashSet<int>();
|
||||
public IReadOnlyCollection<int> DependentFilterListIds { get; init; } = new HashSet<int>();
|
||||
public IEnumerable<int> MaintainerIds { get; init; } = new HashSet<int>();
|
||||
public IEnumerable<int> UpstreamFilterListIds { get; init; } = new HashSet<int>();
|
||||
public IEnumerable<int> ForkFilterListIds { get; init; } = new HashSet<int>();
|
||||
public IEnumerable<int> IncludedInFilterListIds { get; init; } = new HashSet<int>();
|
||||
public IEnumerable<int> IncludesFilterListIds { get; init; } = new HashSet<int>();
|
||||
public IEnumerable<int> DependencyFilterListIds { get; init; } = new HashSet<int>();
|
||||
public IEnumerable<int> DependentFilterListIds { get; init; } = new HashSet<int>();
|
||||
|
||||
public record ViewUrlVm
|
||||
{
|
||||
|
|
|
|||
|
|
@ -6,9 +6,9 @@ public record ListVm
|
|||
public string Name { get; init; } = null!;
|
||||
public string? Description { get; init; }
|
||||
public int? LicenseId { get; init; }
|
||||
public IReadOnlyCollection<int> SyntaxIds { get; init; } = new HashSet<int>();
|
||||
public IReadOnlyCollection<string> Iso6391s { get; init; } = new HashSet<string>();
|
||||
public IReadOnlyCollection<int> TagIds { get; init; } = new HashSet<int>();
|
||||
public IEnumerable<int> SyntaxIds { get; init; } = new HashSet<int>();
|
||||
public IEnumerable<string> Iso6391s { get; init; } = new HashSet<string>();
|
||||
public IEnumerable<int> TagIds { get; init; } = new HashSet<int>();
|
||||
public Uri? PrimaryViewUrl { get; init; }
|
||||
public IReadOnlyCollection<int> MaintainerIds { get; init; } = new HashSet<int>();
|
||||
public IEnumerable<int> MaintainerIds { get; init; } = new HashSet<int>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -48,6 +48,6 @@ public record LanguageVm
|
|||
{
|
||||
public string Iso6391 { get; init; } = null!;
|
||||
public string Name { get; init; } = null!;
|
||||
public IReadOnlyCollection<int> FilterListIds { get; init; } = new HashSet<int>();
|
||||
public IEnumerable<int> FilterListIds { get; init; } = new HashSet<int>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,6 @@ public record LicenseVm
|
|||
public bool PermitsModification { get; init; }
|
||||
public bool PermitsDistribution { get; init; }
|
||||
public bool PermitsCommercialUse { get; init; }
|
||||
public IReadOnlyCollection<int> FilterListIds { get; init; } = new HashSet<int>();
|
||||
public IEnumerable<int> FilterListIds { get; init; } = new HashSet<int>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,6 @@ public record MaintainerVm
|
|||
public Uri? Url { get; init; }
|
||||
public string? EmailAddress { get; init; }
|
||||
public string? TwitterHandle { get; init; }
|
||||
public IReadOnlyCollection<int> FilterListIds { get; init; } = new HashSet<int>();
|
||||
public IEnumerable<int> FilterListIds { get; init; } = new HashSet<int>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,6 +51,6 @@ public record SoftwareVm
|
|||
public Uri? HomeUrl { get; init; }
|
||||
public Uri? DownloadUrl { get; init; }
|
||||
public bool SupportsAbpUrlScheme { get; init; }
|
||||
public IReadOnlyCollection<int> SyntaxIds { get; init; } = new HashSet<int>();
|
||||
public IEnumerable<int> SyntaxIds { get; init; } = new HashSet<int>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ public record SyntaxVm
|
|||
public string Name { get; init; } = null!;
|
||||
public string? Description { get; init; }
|
||||
public Uri? Url { get; init; }
|
||||
public IReadOnlyCollection<int> FilterListIds { get; init; } = new HashSet<int>();
|
||||
public IReadOnlyCollection<int> SoftwareIds { get; init; } = new HashSet<int>();
|
||||
public IEnumerable<int> FilterListIds { get; init; } = new HashSet<int>();
|
||||
public IEnumerable<int> SoftwareIds { get; init; } = new HashSet<int>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,6 +49,6 @@ public record TagVm
|
|||
public int Id { get; init; }
|
||||
public string Name { get; init; } = null!;
|
||||
public string? Description { get; init; }
|
||||
public IReadOnlyCollection<int> FilterListIds { get; init; } = new HashSet<int>();
|
||||
public IEnumerable<int> FilterListIds { get; init; } = new HashSet<int>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@ public record FilterList : AggregateRoot
|
|||
public string? Description { get; init; }
|
||||
public int LicenseId { get; init; }
|
||||
public License License { get; init; } = null!;
|
||||
public IReadOnlyCollection<FilterListSyntax> FilterListSyntaxes { get; init; } = new HashSet<FilterListSyntax>();
|
||||
public IReadOnlyCollection<FilterListLanguage> FilterListLanguages { get; init; } = new HashSet<FilterListLanguage>();
|
||||
public IReadOnlyCollection<FilterListTag> FilterListTags { get; init; } = new HashSet<FilterListTag>();
|
||||
public IReadOnlyCollection<FilterListViewUrl> ViewUrls { get; init; } = new HashSet<FilterListViewUrl>();
|
||||
public IEnumerable<FilterListSyntax> FilterListSyntaxes { get; init; } = new HashSet<FilterListSyntax>();
|
||||
public IEnumerable<FilterListLanguage> FilterListLanguages { get; init; } = new HashSet<FilterListLanguage>();
|
||||
public IEnumerable<FilterListTag> FilterListTags { get; init; } = new HashSet<FilterListTag>();
|
||||
public IEnumerable<FilterListViewUrl> ViewUrls { get; init; } = new HashSet<FilterListViewUrl>();
|
||||
public Uri? HomeUrl { get; init; }
|
||||
public Uri? OnionUrl { get; init; }
|
||||
public Uri? PolicyUrl { get; init; }
|
||||
|
|
@ -23,13 +23,13 @@ public record FilterList : AggregateRoot
|
|||
public Uri? ChatUrl { get; init; }
|
||||
public string? EmailAddress { get; init; }
|
||||
public Uri? DonateUrl { get; init; }
|
||||
public IReadOnlyCollection<FilterListMaintainer> FilterListMaintainers { get; init; } = new HashSet<FilterListMaintainer>();
|
||||
public IReadOnlyCollection<Fork> UpstreamFilterLists { get; init; } = new HashSet<Fork>();
|
||||
public IReadOnlyCollection<Fork> ForkFilterLists { get; init; } = new HashSet<Fork>();
|
||||
public IReadOnlyCollection<Merge> IncludedInFilterLists { get; init; } = new HashSet<Merge>();
|
||||
public IReadOnlyCollection<Merge> IncludesFilterLists { get; init; } = new HashSet<Merge>();
|
||||
public IReadOnlyCollection<Dependent> DependencyFilterLists { get; init; } = new HashSet<Dependent>();
|
||||
public IReadOnlyCollection<Dependent> DependentFilterLists { get; init; } = new HashSet<Dependent>();
|
||||
public IEnumerable<FilterListMaintainer> FilterListMaintainers { get; init; } = new HashSet<FilterListMaintainer>();
|
||||
public IEnumerable<Fork> UpstreamFilterLists { get; init; } = new HashSet<Fork>();
|
||||
public IEnumerable<Fork> ForkFilterLists { get; init; } = new HashSet<Fork>();
|
||||
public IEnumerable<Merge> IncludedInFilterLists { get; init; } = new HashSet<Merge>();
|
||||
public IEnumerable<Merge> IncludesFilterLists { get; init; } = new HashSet<Merge>();
|
||||
public IEnumerable<Dependent> DependencyFilterLists { get; init; } = new HashSet<Dependent>();
|
||||
public IEnumerable<Dependent> DependentFilterLists { get; init; } = new HashSet<Dependent>();
|
||||
}
|
||||
|
||||
internal class FilterListTypeConfiguration : AggregateRootTypeConfiguration<FilterList>
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ public record Language : AggregateRoot
|
|||
{
|
||||
public string Iso6391 { get; init; } = null!;
|
||||
public string Name { get; init; } = null!;
|
||||
public IReadOnlyCollection<FilterListLanguage> FilterListLanguages { get; init; } = new HashSet<FilterListLanguage>();
|
||||
public IEnumerable<FilterListLanguage> FilterListLanguages { get; init; } = new HashSet<FilterListLanguage>();
|
||||
}
|
||||
|
||||
internal class LanguageTypeConfiguration : AggregateRootTypeConfiguration<Language>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ public record License : AggregateRoot
|
|||
public bool PermitsModification { get; init; }
|
||||
public bool PermitsDistribution { get; init; }
|
||||
public bool PermitsCommercialUse { get; init; }
|
||||
public IReadOnlyCollection<FilterList> FilterLists { get; init; } = new HashSet<FilterList>();
|
||||
public IEnumerable<FilterList> FilterLists { get; init; } = new HashSet<FilterList>();
|
||||
}
|
||||
|
||||
internal class LicenseTypeConfiguration : AggregateRootTypeConfiguration<License>
|
||||
|
|
|
|||
|
|
@ -10,7 +10,7 @@ public record Maintainer : AggregateRoot
|
|||
public Uri? Url { get; init; }
|
||||
public string? EmailAddress { get; init; }
|
||||
public string? TwitterHandle { get; init; }
|
||||
public IReadOnlyCollection<FilterListMaintainer> FilterListMaintainers { get; init; } = new HashSet<FilterListMaintainer>();
|
||||
public IEnumerable<FilterListMaintainer> FilterListMaintainers { get; init; } = new HashSet<FilterListMaintainer>();
|
||||
}
|
||||
|
||||
internal class MaintainerTypeConfiguration : AggregateRootTypeConfiguration<Maintainer>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ public record Software : AggregateRoot
|
|||
public Uri? HomeUrl { get; init; }
|
||||
public Uri? DownloadUrl { get; init; }
|
||||
public bool SupportsAbpUrlScheme { get; init; }
|
||||
public IReadOnlyCollection<SoftwareSyntax> SoftwareSyntaxes { get; init; } = new HashSet<SoftwareSyntax>();
|
||||
public IEnumerable<SoftwareSyntax> SoftwareSyntaxes { get; init; } = new HashSet<SoftwareSyntax>();
|
||||
}
|
||||
|
||||
internal class SoftwareTypeConfiguration : AggregateRootTypeConfiguration<Software>
|
||||
|
|
|
|||
|
|
@ -9,8 +9,8 @@ public record Syntax : AggregateRoot
|
|||
public string Name { get; init; } = null!;
|
||||
public string? Description { get; init; }
|
||||
public Uri? Url { get; init; }
|
||||
public IReadOnlyCollection<FilterListSyntax> FilterListSyntaxes { get; init; } = new HashSet<FilterListSyntax>();
|
||||
public IReadOnlyCollection<SoftwareSyntax> SoftwareSyntaxes { get; init; } = new HashSet<SoftwareSyntax>();
|
||||
public IEnumerable<FilterListSyntax> FilterListSyntaxes { get; init; } = new HashSet<FilterListSyntax>();
|
||||
public IEnumerable<SoftwareSyntax> SoftwareSyntaxes { get; init; } = new HashSet<SoftwareSyntax>();
|
||||
}
|
||||
|
||||
internal class SyntaxTypeConfiguration : AggregateRootTypeConfiguration<Syntax>
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ public record Tag : AggregateRoot
|
|||
public int Id { get; init; }
|
||||
public string Name { get; init; } = null!;
|
||||
public string? Description { get; init; }
|
||||
public IReadOnlyCollection<FilterListTag> FilterListTags { get; init; } = new HashSet<FilterListTag>();
|
||||
public IEnumerable<FilterListTag> FilterListTags { get; init; } = new HashSet<FilterListTag>();
|
||||
}
|
||||
|
||||
internal class TagTypeConfiguration : AggregateRootTypeConfiguration<Tag>
|
||||
|
|
|
|||
Loading…
Reference in a new issue