Skip to content

Commit

Permalink
fix Formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdotnet committed Jun 14, 2024
1 parent 8160b79 commit 6663f4c
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/LinkDotNet.Blog.Web/Features/Archive/ArchivePage.razor
Original file line number Diff line number Diff line change
Expand Up @@ -44,20 +44,20 @@
</div>

@code {
private IReadOnlyCollection<IGrouping<int, BlogPostPerYear>> blogPostsPerYear;
private int blogPostCount;
private IReadOnlyCollection<IGrouping<int, BlogPostPerYear>> blogPostsPerYear;
private int blogPostCount;

protected override async Task OnInitializedAsync()
{
var blogPosts = await Repository.GetAllByProjectionAsync(
p => new BlogPostPerYear(p.Id, p.Slug, p.Title, p.UpdatedDate),
p => p.IsPublished);
blogPostCount = blogPosts.Count;
blogPostsPerYear = blogPosts
.GroupBy(r => r.UpdatedDate.Year)
.OrderByDescending(r => r.Key)
.ToImmutableArray();
}
protected override async Task OnInitializedAsync()
{
var blogPosts = await Repository.GetAllByProjectionAsync(
p => new BlogPostPerYear(p.Id, p.Slug, p.Title, p.UpdatedDate),
p => p.IsPublished);
blogPostCount = blogPosts.Count;
blogPostsPerYear = blogPosts
.GroupBy(r => r.UpdatedDate.Year)
.OrderByDescending(r => r.Key)
.ToImmutableArray();
}

private sealed record BlogPostPerYear(string Id, string Slug, string Title, DateTime UpdatedDate);
private sealed record BlogPostPerYear(string Id, string Slug, string Title, DateTime UpdatedDate);
}

0 comments on commit 6663f4c

Please sign in to comment.