File tree Expand file tree Collapse file tree 2 files changed +11
-5
lines changed
LinkDotNet.Blog.Web/Shared/Admin/Dashboard Expand file tree Collapse file tree 2 files changed +11
-5
lines changed Original file line number Diff line number Diff line change 22
22
{ " Since Today" , DateTime .UtcNow .Date },
23
23
};
24
24
25
- private void RaiseDateTimeSpanChanged (ChangeEventArgs args )
25
+ private async Task RaiseDateTimeSpanChanged (ChangeEventArgs args )
26
26
{
27
- Console . WriteLine ( args .Value );
27
+ await DateTimeSpanChanged . InvokeAsync ( DateTime . Parse ( args .Value ! . ToString ()) );
28
28
}
29
29
30
30
}
Original file line number Diff line number Diff line change 9
9
<div class =" card-header" >Blog Post Visit Counts</div >
10
10
<div class =" card-body" >
11
11
<div class =" row" >
12
- <DateRangeSelector ></DateRangeSelector >
12
+ <DateRangeSelector DateTimeSpanChanged = " RefreshVisitCount " ></DateRangeSelector >
13
13
<table class =" table table-striped table-hover" >
14
14
<tbody >
15
15
<tr >
51
51
private async Task LoadBlogPostInformationAsync ()
52
52
{
53
53
visitData = await (from ur in blogDbContext .UserRecords
54
- join bp in blogDbContext .BlogPosts .Where (b => b .UpdatedDate > startDate )
54
+ where ur .DateTimeUtcClicked > startDate
55
+ join bp in blogDbContext .BlogPosts
55
56
on ur .UrlClicked .Replace (" blogPost/" , string .Empty ) equals bp .Id
56
- where bp .UpdatedDate > startDate
57
57
group new { ur , bp } by new { ur .UrlClicked }
58
58
into gp
59
59
orderby gp .Count () descending
65
65
ClickCount = gp .Count ()
66
66
}).ToListAsync ();
67
67
}
68
+
69
+ private async Task RefreshVisitCount (DateTime newBeginning )
70
+ {
71
+ startDate = newBeginning ;
72
+ await LoadBlogPostInformationAsync ();
73
+ }
68
74
}
You can’t perform that action at this time.
0 commit comments