Skip to content

Commit

Permalink
Fixed spelling mistake and used differnt data structure
Browse files Browse the repository at this point in the history
  • Loading branch information
linkdotnet committed Apr 24, 2023
1 parent 9fb5469 commit c733862
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
</table>
@if (ShowAdminActions)
{
<small for="skill-table">You can drag and drop your skills from one proficency to another</small>
<small for="skill-table">You can drag and drop your skills from one proficiency to another</small>
}
</div>
@code {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
@using LinkDotNet.Blog.Infrastructure.Persistence
@using LinkDotNet.Blog.Infrastructure.Persistence.Sql
@using LinkDotNet.Blog.Web.Features.Admin.Dashboard.Services
@using System.Collections.Immutable
@inject IRepository<BlogPost> BlogPostRepository
@inject IRepository<UserRecord> UserRecordRepository

Expand Down Expand Up @@ -51,14 +52,14 @@
@code {

private Filter filter = new();
private IList<VisitCountPageData> visitData;
private IReadOnlyCollection<VisitCountPageData> visitData;

protected override async Task OnInitializedAsync()
{
visitData = await LoadBlogPostInformationAsync();
}

private async Task<List<VisitCountPageData>> LoadBlogPostInformationAsync()
private async Task<IReadOnlyCollection<VisitCountPageData>> LoadBlogPostInformationAsync()
{
var blogPostsTask = BlogPostRepository.GetAllByProjectionAsync(
s => new { s.Id, s.Title, s.Likes });
Expand All @@ -81,7 +82,7 @@
Title = gp.First().bp.Title,
Likes = gp.First().bp.Likes,
ClickCount = gp.Count()
}).ToList();
}).ToImmutableArray();
return visitCountPage;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Collections.Immutable;
using System.Linq;
using System.Threading.Tasks;
using LinkDotNet.Blog.Domain;
Expand Down Expand Up @@ -49,7 +50,7 @@ private IEnumerable<SitemapUrl> CreateUrlsForBlogPosts(IEnumerable<BlogPost> blo
{
Location = $"{navigationManager.BaseUri}blogPost/{b.Id}",
LastModified = b.UpdatedDate.ToString("yyyy-MM-dd"),
}).ToList();
}).ToImmutableArray();
}

private IEnumerable<SitemapUrl> CreateUrlsForTags(IEnumerable<BlogPost> blogPosts)
Expand Down
5 changes: 3 additions & 2 deletions src/LinkDotNet.Blog.Web/Features/Archive/ArchivePage.razor
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
@page "/archive"
@using LinkDotNet.Blog.Infrastructure.Persistence
@using LinkDotNet.Blog.Domain
@using System.Collections.Immutable
@inject IRepository<BlogPost> Repository

<OgData Title="Archive"></OgData>
Expand Down Expand Up @@ -28,7 +29,7 @@
</div >

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

protected override async Task OnInitializedAsync()
Expand All @@ -40,7 +41,7 @@
blogPostsPerYear = blogPosts
.GroupBy(r => r.UpdatedDate.Year)
.OrderByDescending(r => r.Key)
.ToList();
.ToImmutableArray();
}

private sealed record BlogPostPerYear(string Id, string Title, DateTime UpdatedDate);
Expand Down

0 comments on commit c733862

Please sign in to comment.