Skip to content

Commit c733862

Browse files
committed
Fixed spelling mistake and used differnt data structure
1 parent 9fb5469 commit c733862

File tree

4 files changed

+10
-7
lines changed

4 files changed

+10
-7
lines changed

src/LinkDotNet.Blog.Web/Features/AboutMe/Components/Skill/SkillTable.razor

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
</table>
5252
@if (ShowAdminActions)
5353
{
54-
<small for="skill-table">You can drag and drop your skills from one proficency to another</small>
54+
<small for="skill-table">You can drag and drop your skills from one proficiency to another</small>
5555
}
5656
</div>
5757
@code {

src/LinkDotNet.Blog.Web/Features/Admin/Dashboard/Components/VisitCountPerPage.razor

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
@using LinkDotNet.Blog.Infrastructure.Persistence
55
@using LinkDotNet.Blog.Infrastructure.Persistence.Sql
66
@using LinkDotNet.Blog.Web.Features.Admin.Dashboard.Services
7+
@using System.Collections.Immutable
78
@inject IRepository<BlogPost> BlogPostRepository
89
@inject IRepository<UserRecord> UserRecordRepository
910

@@ -51,14 +52,14 @@
5152
@code {
5253

5354
private Filter filter = new();
54-
private IList<VisitCountPageData> visitData;
55+
private IReadOnlyCollection<VisitCountPageData> visitData;
5556

5657
protected override async Task OnInitializedAsync()
5758
{
5859
visitData = await LoadBlogPostInformationAsync();
5960
}
6061

61-
private async Task<List<VisitCountPageData>> LoadBlogPostInformationAsync()
62+
private async Task<IReadOnlyCollection<VisitCountPageData>> LoadBlogPostInformationAsync()
6263
{
6364
var blogPostsTask = BlogPostRepository.GetAllByProjectionAsync(
6465
s => new { s.Id, s.Title, s.Likes });
@@ -81,7 +82,7 @@
8182
Title = gp.First().bp.Title,
8283
Likes = gp.First().bp.Likes,
8384
ClickCount = gp.Count()
84-
}).ToList();
85+
}).ToImmutableArray();
8586
return visitCountPage;
8687
}
8788

src/LinkDotNet.Blog.Web/Features/Admin/Sitemap/Services/SitemapService.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.Collections.Generic;
3+
using System.Collections.Immutable;
34
using System.Linq;
45
using System.Threading.Tasks;
56
using LinkDotNet.Blog.Domain;
@@ -49,7 +50,7 @@ private IEnumerable<SitemapUrl> CreateUrlsForBlogPosts(IEnumerable<BlogPost> blo
4950
{
5051
Location = $"{navigationManager.BaseUri}blogPost/{b.Id}",
5152
LastModified = b.UpdatedDate.ToString("yyyy-MM-dd"),
52-
}).ToList();
53+
}).ToImmutableArray();
5354
}
5455

5556
private IEnumerable<SitemapUrl> CreateUrlsForTags(IEnumerable<BlogPost> blogPosts)

src/LinkDotNet.Blog.Web/Features/Archive/ArchivePage.razor

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
@page "/archive"
22
@using LinkDotNet.Blog.Infrastructure.Persistence
33
@using LinkDotNet.Blog.Domain
4+
@using System.Collections.Immutable
45
@inject IRepository<BlogPost> Repository
56

67
<OgData Title="Archive"></OgData>
@@ -28,7 +29,7 @@
2829
</div >
2930

3031
@code {
31-
private List<IGrouping<int, BlogPostPerYear>> blogPostsPerYear;
32+
private IReadOnlyCollection<IGrouping<int, BlogPostPerYear>> blogPostsPerYear;
3233
private int blogPostCount;
3334

3435
protected override async Task OnInitializedAsync()
@@ -40,7 +41,7 @@
4041
blogPostsPerYear = blogPosts
4142
.GroupBy(r => r.UpdatedDate.Year)
4243
.OrderByDescending(r => r.Key)
43-
.ToList();
44+
.ToImmutableArray();
4445
}
4546

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

0 commit comments

Comments
 (0)