File tree Expand file tree Collapse file tree 4 files changed +10
-7
lines changed
src/LinkDotNet.Blog.Web/Features Expand file tree Collapse file tree 4 files changed +10
-7
lines changed Original file line number Diff line number Diff line change 51
51
</table >
52
52
@if (ShowAdminActions )
53
53
{
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 >
55
55
}
56
56
</div >
57
57
@code {
Original file line number Diff line number Diff line change 4
4
@using LinkDotNet .Blog .Infrastructure .Persistence
5
5
@using LinkDotNet .Blog .Infrastructure .Persistence .Sql
6
6
@using LinkDotNet .Blog .Web .Features .Admin .Dashboard .Services
7
+ @using System .Collections .Immutable
7
8
@inject IRepository <BlogPost > BlogPostRepository
8
9
@inject IRepository <UserRecord > UserRecordRepository
9
10
51
52
@code {
52
53
53
54
private Filter filter = new ();
54
- private IList <VisitCountPageData > visitData ;
55
+ private IReadOnlyCollection <VisitCountPageData > visitData ;
55
56
56
57
protected override async Task OnInitializedAsync ()
57
58
{
58
59
visitData = await LoadBlogPostInformationAsync ();
59
60
}
60
61
61
- private async Task <List <VisitCountPageData >> LoadBlogPostInformationAsync ()
62
+ private async Task <IReadOnlyCollection <VisitCountPageData >> LoadBlogPostInformationAsync ()
62
63
{
63
64
var blogPostsTask = BlogPostRepository .GetAllByProjectionAsync (
64
65
s => new { s .Id , s .Title , s .Likes });
81
82
Title = gp .First ().bp .Title ,
82
83
Likes = gp .First ().bp .Likes ,
83
84
ClickCount = gp .Count ()
84
- }).ToList ();
85
+ }).ToImmutableArray ();
85
86
return visitCountPage ;
86
87
}
87
88
Original file line number Diff line number Diff line change 1
1
using System ;
2
2
using System . Collections . Generic ;
3
+ using System . Collections . Immutable ;
3
4
using System . Linq ;
4
5
using System . Threading . Tasks ;
5
6
using LinkDotNet . Blog . Domain ;
@@ -49,7 +50,7 @@ private IEnumerable<SitemapUrl> CreateUrlsForBlogPosts(IEnumerable<BlogPost> blo
49
50
{
50
51
Location = $ "{ navigationManager . BaseUri } blogPost/{ b . Id } ",
51
52
LastModified = b . UpdatedDate . ToString ( "yyyy-MM-dd" ) ,
52
- } ) . ToList ( ) ;
53
+ } ) . ToImmutableArray ( ) ;
53
54
}
54
55
55
56
private IEnumerable < SitemapUrl > CreateUrlsForTags ( IEnumerable < BlogPost > blogPosts )
Original file line number Diff line number Diff line change 1
1
@page " /archive"
2
2
@using LinkDotNet .Blog .Infrastructure .Persistence
3
3
@using LinkDotNet .Blog .Domain
4
+ @using System .Collections .Immutable
4
5
@inject IRepository <BlogPost > Repository
5
6
6
7
<OgData Title =" Archive" ></OgData >
28
29
</div >
29
30
30
31
@code {
31
- private List <IGrouping <int, BlogPostPerYear >> blogPostsPerYear ;
32
+ private IReadOnlyCollection <IGrouping <int, BlogPostPerYear >> blogPostsPerYear ;
32
33
private int blogPostCount ;
33
34
34
35
protected override async Task OnInitializedAsync ()
40
41
blogPostsPerYear = blogPosts
41
42
.GroupBy (r => r .UpdatedDate .Year )
42
43
.OrderByDescending (r => r .Key )
43
- .ToList ();
44
+ .ToImmutableArray ();
44
45
}
45
46
46
47
private sealed record BlogPostPerYear (string Id , string Title , DateTime UpdatedDate );
You can’t perform that action at this time.
0 commit comments