mirror of
https://github.com/collinbarrett/FilterLists.git
synced 2026-03-11 09:04:27 +00:00
refactor(dir): ♻ prefer empty over null collections per https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/guidelines-for-collections\#collection-properties-and-return-values
This commit is contained in:
parent
552d36eea7
commit
aa377e9956
8 changed files with 22 additions and 22 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 IEnumerable<int>? SyntaxIds { get; init; }
|
||||
public IEnumerable<string>? Iso6391s { get; init; }
|
||||
public IEnumerable<int>? TagIds { get; init; }
|
||||
public IEnumerable<ViewUrlVm>? ViewUrls { 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 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 IEnumerable<int>? MaintainerIds { get; init; }
|
||||
public IEnumerable<int>? UpstreamFilterListIds { get; init; }
|
||||
public IEnumerable<int>? ForkFilterListIds { get; init; }
|
||||
public IEnumerable<int>? IncludedInFilterListIds { get; init; }
|
||||
public IEnumerable<int>? IncludesFilterListIds { get; init; }
|
||||
public IEnumerable<int>? DependencyFilterListIds { get; init; }
|
||||
public IEnumerable<int>? DependentFilterListIds { 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 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 IEnumerable<int>? SyntaxIds { get; init; }
|
||||
public IEnumerable<string>? Iso6391s { get; init; }
|
||||
public IEnumerable<int>? TagIds { 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 Uri? PrimaryViewUrl { get; init; }
|
||||
public IEnumerable<int>? MaintainerIds { get; init; }
|
||||
public IReadOnlyCollection<int> MaintainerIds { get; init; } = new HashSet<int>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -50,6 +50,6 @@ public record LanguageVm
|
|||
{
|
||||
public string Iso6391 { get; init; } = null!;
|
||||
public string Name { get; init; } = null!;
|
||||
public IEnumerable<int>? FilterListIds { get; init; }
|
||||
public IReadOnlyCollection<int> FilterListIds { get; init; } = new HashSet<int>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,6 @@ public record LicenseVm
|
|||
public bool PermitsModification { get; init; }
|
||||
public bool PermitsDistribution { get; init; }
|
||||
public bool PermitsCommercialUse { get; init; }
|
||||
public IEnumerable<int>? FilterListIds { get; init; }
|
||||
public IReadOnlyCollection<int> FilterListIds { get; init; } = new HashSet<int>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,6 @@ public record MaintainerVm
|
|||
public Uri? Url { get; init; }
|
||||
public string? EmailAddress { get; init; }
|
||||
public string? TwitterHandle { get; init; }
|
||||
public IEnumerable<int>? FilterListIds { get; init; }
|
||||
public IReadOnlyCollection<int> FilterListIds { get; init; } = new HashSet<int>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -52,6 +52,6 @@ public record SoftwareVm
|
|||
public Uri? HomeUrl { get; init; }
|
||||
public Uri? DownloadUrl { get; init; }
|
||||
public bool SupportsAbpUrlScheme { get; init; }
|
||||
public IEnumerable<int>? SyntaxIds { get; init; }
|
||||
public IReadOnlyCollection<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 IEnumerable<int>? FilterListIds { get; init; }
|
||||
public IEnumerable<int>? SoftwareIds { get; init; }
|
||||
public IReadOnlyCollection<int> FilterListIds { get; init; } = new HashSet<int>();
|
||||
public IReadOnlyCollection<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 IEnumerable<int>? FilterListIds { get; init; }
|
||||
public IReadOnlyCollection<int> FilterListIds { get; init; } = new HashSet<int>();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue