aboutsummaryrefslogtreecommitdiff
path: root/Timeline/Models/Http
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2020-02-02 22:37:47 +0800
committercrupest <crupest@outlook.com>2020-02-02 22:37:47 +0800
commitc4fcf37d6018a0a0408920593fbfb7c01af96859 (patch)
tree38f99c0b8631d34facfe81c23bab274168643040 /Timeline/Models/Http
parentb9dc0062241f4dcf5221808d97a7e4c337a8b6cc (diff)
downloadtimeline-c4fcf37d6018a0a0408920593fbfb7c01af96859.tar.gz
timeline-c4fcf37d6018a0a0408920593fbfb7c01af96859.tar.bz2
timeline-c4fcf37d6018a0a0408920593fbfb7c01af96859.zip
...
Diffstat (limited to 'Timeline/Models/Http')
-rw-r--r--Timeline/Models/Http/TimelineCommon.cs17
1 files changed, 16 insertions, 1 deletions
diff --git a/Timeline/Models/Http/TimelineCommon.cs b/Timeline/Models/Http/TimelineCommon.cs
index 0b2a714c..1cb47dac 100644
--- a/Timeline/Models/Http/TimelineCommon.cs
+++ b/Timeline/Models/Http/TimelineCommon.cs
@@ -52,7 +52,7 @@ namespace Timeline.Models.Http
public static class TimelineInfoExtensions
{
- public static TimelineInfo FillLinks(this TimelineInfo info, IUrlHelper urlHelper)
+ public static TimelineInfo FillLinksForPersonalTimeline(this TimelineInfo info, IUrlHelper urlHelper)
{
if (info == null)
throw new ArgumentNullException(nameof(info));
@@ -66,5 +66,20 @@ namespace Timeline.Models.Http
return info;
}
+
+ public static TimelineInfo FillLinksForNormalTimeline(this TimelineInfo info, IUrlHelper urlHelper)
+ {
+ if (info == null)
+ throw new ArgumentNullException(nameof(info));
+ if (urlHelper == null)
+ throw new ArgumentNullException(nameof(urlHelper));
+
+ info._links = new TimelineInfoLinks
+ {
+ Posts = urlHelper.ActionLink(nameof(TimelineController.PostListGet), nameof(TimelineController)[0..^nameof(Controller).Length], new { info.Name })
+ };
+
+ return info;
+ }
}
}